View Single Post
Old 06-09-2006, 11:11   #2 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,127
Not sure exactly what's wrong with that, but this works

Code:
document.getElementById('id').onmousemove=function(e) { var blah = mousepos(e); alert(blah.x); alert(blah.y); }; function mousepos(e) { var x = 0; var y = 0; if (window.event) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; } else { x = e.clientX; y = e.clientY; } return({x:x,y:y}); }
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote