It does work but not giving the same offset each time you drag. This is what is have been seeing when dragging from the exact same position on the image, I am drag from the + 2nd from the left and 2nd from the top of the image and this is my results.
x=28 y=29 x=28 y=29 x=22 y=13 x=28 y=31 x=20 y=14 x=38 y=23 x=12 y=19 On Thu, Dec 3, 2009 at 2:26 PM, CroNiX <[email protected]> wrote: > I might be misunderstanding, but doesn't this work? > $$('.binpart').each(function(el) { > var myDrag = el.makeDraggable({ > onStart: function(el, evt) { > this.offsets = this.element.getPosition(); > }, > > onDrop: function(element, event) { > console.log(this.offsets); > } > }); > }) > > On Dec 3, 12:12 pm, Trevor Orr <[email protected]> wrote: > > I am still running into the same issue. > > > > http://mooshell.net/3QGQ4/ > > > > On Thu, Dec 3, 2009 at 12:40 AM, Roman Land <[email protected]> > wrote: > > > Try this code instead what you are using to calculate offset > > > > >http://www.quirksmode.org/blog/archives/2008/01/using_the_assig.html > > > > > Inside you example here: > > >http://mooshell.net/2uUvc/ > > > > > On Thu, Dec 3, 2009 at 6:49 AM, Trevor Orr <[email protected]> wrote: > > > > >> Here is a very stripped down chunk of the code. > > >>http://mooshell.net/PhjEU/ > > > > >> The end goal here is to get the X/Y coordinates from the top left > corner > > >> of the image where the drag was started from. > > > > >> On Wed, Dec 2, 2009 at 11:44 AM, Trevor Orr <[email protected]> > wrote: > > > > >>> I guess I could rip out that part of my application, might take a bit > of > > >>> work but probably the best way. > > > > >>> I guess one other issue could be a slow computer not processing > > >>> JavaScript very fast. > > > > >>> On Wed, Dec 2, 2009 at 10:31 AM, Roman Land <[email protected] > >wrote: > > > > >>>> Can you put up an example in mooshell.net? > > > > >>>> Cheers > > >>>> -- Roman > > > > >>>> On Wed, Dec 2, 2009 at 8:23 PM, Trevor Orr <[email protected]> > wrote: > > > > >>>>> I am wanting to get the X/Y mouse coordinates when dragging an > image. > > >>>>> The problem I am having is this. > > > > >>>>> 1) Quickly click and drag, the X/Y coordinates I get vary quick > > >>>>> dramatically. > > > > >>>>> 2) Clicking, pause for a second and then drag, X/Y coordinates I > get > > >>>>> almost exactly the same. > > > > >>>>> So it seems that either events are not firing off quickly enough in > > >>>>> JavaScript to get accurate X/Y coordinates when doing things > quickly or > > >>>>> events are not firing off quickly enough in Mootools or I have some > bad > > >>>>> code. > > > > >>>>> I am just wondering if anyone has experienced this and if so is > there a > > >>>>> solution. > > > > >>>> -- > > >>>> --- > > >>>> "Make everything as simple as possible, but not simpler." > > > > >>>> - Albert Einstein > > > > > -- > > > --- > > > "Make everything as simple as possible, but not simpler." > > > > > - Albert Einstein >
