< JavaScript
JavaScript Console Tests
Test x,y
window.onmouseover = function(){document.title = [event.x,event.y];};
Test offsetX,offsetY
window.onmouseover = function(){document.title = [event.offsetX,event.offsetY];};
Test clientX,clientY
window.onmouseover = function(){document.title = [event.clientX,event.clientY];};
Test pageX,pageY
window.onmouseover = function(){document.title = [event.pageX,event.pageY];};
References
Further reading
- JavaScript Events
- offsetX Property
- CSS Object Model: Extensions to the mouseevent Interface
- Creating an HTML5 Canvas Painting Application
- DOM Events Portability: Not that Hard
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.