Image jQuery scroller in a container. (like facebook cropper) can't get values of position.

Posted by Stefan on Stack Overflow See other posts from Stack Overflow or by Stefan
Published on 2010-04-21T20:32:16Z Indexed on 2010/04/21 20:33 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

Hey all.

Having a reallllll mind pain.

I have a php image uploader which is all good and sotring the file and the jquery ajax is returning the image in an ammended html div with a div set up like this:

#crop-holder {
  width:80px;
  height:80px;
  margin:10px 10px 20px 10px;
  border:1px #c0c0c0 solid;
  overflow:hidden;
  cursor:move;
 }

The image is viewing fine and I am using the jquery scrollview plugin: http://code.google.com/p/jquery-scrollview/

I have tried adding a few lines to the plugin to store variables of scrollTop and Left and then replacing two hidden input values with x and y in my page. And then on the returned ajax html in the div I am trying to on a button click (for example) retrieve the values of the two hidden inputs....

Heres what i added to the plugin (i'm no js expert!):

.mouseout(function(){ 
 var _m = this.m;
    var lasty = _m.scrollTop();
   getElementById("ycord").value = lasty;
   var lastx = _m.scrollLeft();
  getElementById("xcord").value = lastx;
   self.stopgrab();
             })

Still no luck!!

How can I get the scrollTop and scrollLeft and successfully prepare them for sending onto another php script!?

Thanks:)

stefpretty

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about facebook