Example
$(document).on("mousemove",function( event ) {
$("#X").html("X : "+event.pageX);
$("#Y").html("Y : "+event.pageY);
});
Find the mouse position when over the particular div
In the above one is used to find the mouse x and y position everywhere mouse over on the webpage. But If you want to know whenever mouse over on the specific page, just keep the below example.
Example
$("#overalldiv").on("mousemove",function( event ) {
$("#X2").html("X2 : "+event.pageX);
$("#Y2").html("Y2 : "+event.pageY);
});
Example Program:- (Editor)
Advertisement
Nicely explained
ReplyDeleteThanks
Delete