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
How can I prevent photoswipe to unbind my scroll event? #1059
Comments
Please provide a reduced test case (isolated example) that reproduces the problem. You may create it based on CodePens in PhotoSwipe documentation: raw gallery, gallery with thumbnails, custom HTML content in slides. If you're not comfortable with CodePen, you may export code via |
Hi, I have the same issue here. I'm also using jQuery in my code. After closing PhotoSwipe, the scroll I binded on the window isn't throwing the scroll event anymore. I tried to rebind the scroll event but it's not doing anything, the window scroll seems to just be dead (or prevented somehow). And then when I call the scrollTop function, it's always returning 0. I created a codepen (http://codepen.io/anon/pen/YwJqeB), but I can't reproduce the problem inside it. It's driving crazy me ^^ |
@cireme, remove all js/css not related to PhotoSwipe from the page where you get the problem, and link to it (or attach to message), and I might help. I can not assist you without a reduced test case. |
i have the same problem. when photoswipe is open and close it. so the $(window).on("scroll",fun...);isnt work. i cant to findout someone options of event to prevent it . |
@dimsemenov Hey, thanks for the answer. I understand. I'll see if I have time to rollback on the code to get to the state where it isn't working. But I've been working on the problem on my side by debugging the plugin and I don't get where the problem comes from. @lpsm The solution I choose on my app was to add a wrapper on the whole page and handle my page scroll on it, so I don't interact at all with the window and PS's binding anymore. |
yeah! thank to @huanxijiuhao you are right! thats work well . |
[situation]
I have problems about photoswipe close. I have a html page A using Photoswipe for a photo view. I have defined a scroll event in page A. When I open and then close photoswipe and go back to my page A, the scroll event is not working any more.
My scroll event:
I noticed photoswipe's close and destory method, which executes the unbind function.
The text was updated successfully, but these errors were encountered: