thdoan / magnify

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

jQuery mousedown event does not get triggered once the zoom lense is active #52

Closed manikbajaj closed 5 years ago

manikbajaj commented 5 years ago

I have tried a lot but the mousedown event does not fire when the zoom lens is active. We need to track the mousedown event so that we are able to find the mouse position and then use RaphaelJs to draw lines on the image. Can you please take a look at this and let me know if there is a workaround.

thdoan commented 5 years ago

It should work if you use event delegation in jQuery and bind it to lens container.

manikbajaj commented 5 years ago

@thdoan thank you for your reply I will try this

manikbajaj commented 5 years ago

@thdoan I have been struggling with the solution posted by you. Would be really grateful if you have a look at the Stackoverflow question I have created. I have a link to the jsFiddle as well in there for a clear picture on the problem I am facing.

manikbajaj commented 5 years ago

https://stackoverflow.com/questions/54454260/a-way-to-bind-the-mousedown-event-on-magnifier-to-raphael-canvas

thdoan commented 5 years ago

As a quick fix, try changing line 232 from $container.off().on(...) to $container.on(...).