Reputation: 7635
Imagine two different windows with the same page loaded but different sizes. I want to pass the mouse coordinates from one window to the second window in order to point to the same location in both page.
How can I convert the mouse coordinates of the first window to fit in the second?
Upvotes: 0
Views: 51
Reputation: 13211
otherMouseX = thisMouseX / thisWindowWidth * otherWindowWidth
and the same for mouse y
Upvotes: 2