Saturday 15 February 2014

JavaScript: mouse coordinates -


I have two div boxes: one big that is the parent for the other, which is small. With propeties offsetX and offsetY, I find out the coerinates of the mouse pointer. I only need the relative coordinates of the large box, but when the mouse pointer exceeds the small box, the coordinates are drawn relative to this small box. How do I get the coordinates compared to the larger box, even if the mouse pointer is more than the small box?

I think this is because the small box is located at all or relative ( position: Complete position: relative ). Can you change it so that only parents are fully deployed?

Otherwise, the JS Framework needs to change you relative to full position, and correlate them with the mouse cursor.

/ div>

No comments:

Post a Comment