• 0

PageX and pageY for IE


Question

I want to know what are the pageX and pageY equivalents for IE. pageX and pageY work on firefox, they are great because they get the actual position of the mouse relative to the page and not the window like clientX and clientY. any suggestions?

thanks guys

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

QuirksMode has this script fragment

if (e.pageX || e.pageY) {
	posx = e.pageX;
	posy = e.pageY;
}
else if (e.clientX || e.clientY) {
	posx = e.clientX + document.body.scrollLeft
		+ document.documentElement.scrollLeft;
	posy = e.clientY + document.body.scrollTop
		+ document.documentElement.scrollTop;
}

e is the event, posx and posy now contain the pageX and pageY values, if IE supported them.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.