本文介绍了宏伟的弹出窗口和无限滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个tumblr博客,里面有精细的滚动和放大弹出窗口,可以形象地显示图像.
I have a tumblr blog whit infine scrolling and magnific-popup to visualize the image.
当我滚动到底部并加载新帖子时,magnific-popup在加载的新帖子中不起作用,而仅在旧帖子中起作用.
When I scroll to the bottom and load new posts, magnific-popup doesn't works in the new posts loaded but only in the old.
如果我尝试手动转到第2页",则一切正常.
If I try to go to "page-2" manually everything works.
有没有一种方法可以在加载桩或类似的东西上重新加载magnific-popup?
Is there a way to reload magnific-popup on load posts or something similar?
非常感谢
推荐答案您需要做的就是在无限滚动加载时在新元素上调用.magnificPopup方法,方法是:
All you need to do is call the .magnificPopup method on the new elements when infinitescroll is loaded, this way:
$YOUR_CONTAINER.infinitescroll({ navSelector: ".Pagination", nextSelector: ".Pagination-next", itemSelector: ".Post" }, function( newElements ) { $(newElements).magnificPopup({/*your options here*/}); });更多推荐
宏伟的弹出窗口和无限滚动
发布评论