宏伟的弹出窗口和无限滚动

编程入门 行业动态 更新时间:2024-10-28 00:24:53
本文介绍了宏伟的弹出窗口和无限滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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*/}); });

更多推荐

宏伟的弹出窗口和无限滚动

本文发布于:2023-08-06 02:13:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1309447.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:宏伟   弹出窗口

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!