Monday, January 19, 2009

JS: Get Mouse Position

This code shows returns the current mouse position,

// private method. Returns mouse position
// this code will work in firefox also

_getMousePosition : function (e)
{
e = e ? e : window.event;
var position =
{
'x' : e.clientX,
'y' : e.clientY
}
return position;
}

No comments:

Post a Comment