you could always attach another event to #mydiv, which tracks the mouse position using pointerX and pointerY or something cross browser (I copyied a function). Saying something like this:
$("#mydiv").bind("mouseover", findCoords);
function findCoords(e) {
if( !e ) { e = window.event; } if( !e || ( typeof( e.pageX ) != 'number' && typeof( e.clientX ) != 'number' ) ) { return [ 0, 0 ]; }
if( typeof( e.pageX ) == 'number' ) { var posX =
e.pageX; var posY = e.pageY; } else {
var posX = e.clientX; var posY = e.clientY;
if( !( ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) || ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
window.navigator.vendor == 'KDE' ) ) {
if( document.documentElement && ( document.documentElement.scrollTop || document.documentElement.scrollLeft ) ) {
posX += document.documentElement.scrollLeft
; posY += document.documentElement.scrollTop;
} else if( document.body && ( document.body.scrollTop || document.body.scrollLeft ) ) {
posX += document.body.scrollLeft; posY += document.body.scrollTop
;
}
}
_mydivPosition [ posX, posY ];
}
}
now you have a global array _mydivPosition which you can use in your ondrop function...probably not the fanciest way, but it should work.
2006/10/11, Lolo <[EMAIL PROTECTED]>:
Hi,
I am using the http://interface.eyecon.ro/docs/drop JQuery interface plugin
to drag images and drop them in a div.
How could I get the mouse position (event) in the ondrop handler ?
Example:
=====
$('#mydiv').Droppable({accept:'myimageclass',ondrop:function(drag)
{
/* How can I access the screen or client mouse coordinate here ? */
}
});
Thanks
Laurent
--
View this message in context: http://www.nabble.com/JQuery-interface-plugin%3A-ondrop-mouse-position---tf2425125.html#a6761693
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Paul Bakaus
Web Developer
------------------------
Hildastr. 35
79102 Freiburg
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
