Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if the img is new created by js, zoom doesn`t work. Is there a solution? #85

Open
weipingcui opened this issue Dec 23, 2016 · 2 comments

Comments

@weipingcui
Copy link

weipingcui commented Dec 23, 2016

if the img is new created by js, zoom doesnt work. Is there a solution? I am sorry. It works. But Just I cant find the picture on the screen. Does some one have this problem?

@nishanths
Copy link

It doesn't work because the listen function which registers the click handler on the images is called only once at the start. So images inserted after the page is ready will not work.

I can't think of quick fix since no global variables are exposed by the plugin.

@spinningarrow
Copy link

It doesn't work because the listen function which registers the click handler on the images is called only once at the start. So images inserted after the page is ready will not work.

I don't think that's completely accurate. It's true that listen is called at the start but if you see

this._$body.on('click', '[data-action="zoom"]', $.proxy(this._zoom, this))
it adds an event handler for click events on <body>. Even if a new image is created dynamically, clicking on it should bubble up and everything should work.

@weipingcui can you share a JSfiddle/CodePen/equivalent example of what you're doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants