thdoan / magnify

A lightweight jQuery magnifying glass zoom plugin.
https://thdoan.github.io/magnify/
MIT License
244 stars 64 forks source link

relative vs. absolute mouse position for elementFromPoint for usemap #28

Closed dcasey160 closed 7 years ago

dcasey160 commented 7 years ago

We love this plugin, and are using it in the middle of a page, after a banner, menu bar, etc. We found that the image map was not getting clicks like we'd expect. I changed the lines in this block: "$container.click(function(e) { // Trigger click on image below lens at current cursor position" to use clientX and clientY vs. pageX and pageY, and that solved the problem. I wasn't too familiar with this but this note was helpful: http://www.zehnet.de/2010/11/19/document-elementfrompoint-a-jquery-solution/ . Thank you!

thdoan commented 7 years ago

Thank you for this. I will test and implement your change in the next minor release :+1: