alpineedge3,

I just Googled 'window.event.screenX' and, you're right, it seems to
be a valid native way to get the mouse coordinates. I just learned
this new stuff today! :-)

But as per my experience, calling an alert dialog in some dynamic/
anychronous JavaScript can cause trouble.

Just try getting these coordinates without using an alert, with a
variable, and it should work.




On Sep 8, 8:17 pm, alpineedge3 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I need to record the new position of a dragged div. I know the
> starting position, so my plan is to calculate the change in screen
> cursor positions from drag to drop, and add to the div's position. my
> problem is that window.event.screenX or window.event.screenY are not
> working within the new Draggable() function:
>
> [code]
> echo "new Draggable('$div',{onStart:function()
> {alert(window.event.screenX);},".
>        "onEnd:function()
> {stopDragStuff('$div',window.event.screenX,window.event.screenY);}".
>         "alert('['+screenx+','+screeny+']');}" .
>         "});\n";
> [/code]
>
> in the above caes, the alert doesn't work, the function doesn't work
> and the draggable div doesn't stop moving onrelease. i have to double
> click to get it to drop (and no function works in this case either).
>
> any suggestions?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to