thdoan / magnify

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

Re-initialize zoom after destroy #31

Closed anmamtl closed 7 years ago

anmamtl commented 7 years ago

Hello ;)

Is there a way/method to reactivate the zoom after it has been destroyed? I looking to implement for an off/on option.

Thank you so much!

thdoan commented 7 years ago

I noticed you self-closed. You can reactivate using the same .magnify() method.

anmamtl commented 7 years ago

Hi Tom ;)

Yeah, I closed it because I found the solutions minutes after lol. But it is exactly what you said ;) Thanks for following up!

Quick question: Is is possible make the lens appear only when we click my custom "on" button? And that by default, we don't see the lens? It works by removing the "display:none" in the css, but is it possible to load the page and have the lens and function deactivated on first load?

Thanks so much!!

A nnie

On Wed, Jan 4, 2017 at 2:50 AM Tom Doan notifications@github.com wrote:

I noticed you self-closed. You can reactivate using the same .magnify() method.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/thdoan/magnify/issues/31#issuecomment-270312528, or mute the thread https://github.com/notifications/unsubscribe-auth/AGZfqh7PGWbs85swrPMKvPJGBU7Pjdunks5rO09ZgaJpZM4LaC5u .

-- *— A N N I E N G O —*

Pigiste / Freelance Web ◇ Design ◇ Vidéo

thdoan commented 7 years ago

@anmamtl this can be accomplished with some JavaScript. On a high level, you can create a 'click' event handler for your custom "on" button that adds a class to the container div (the class name can be something like "active" or "on"). To hide the lens initially, you can override the default CSS and only have it displayed when the container has the class you toggled by clicking on the "on" button.