简体   繁体   English

无限的ajax滚动没有加载JavaScript

[英]infinite ajax scroll not loading javascript

SO basically I am using this plugin 所以基本上我正在使用这个插件

https://github.com/webcreate/Infinite-Ajax-Scroll https://github.com/webcreate/Infinite-Ajax-Scroll

It fits my needs perfectly and is working pretty seamless. 它非常符合我的需求,并且工作非常顺畅。

My website is articles, the problem is the javascript only appears for the first page of data. 我的网站是文章,问题是javascript只出现在第一页的数据中。

For example, my facebook like buttons, hover effect, etc etc only works for the original rows loaded, not for the rows loaded by the plugin when you scroll to load more. 例如,我的facebook像按钮,悬停效果等等只适用于加载的原始行,而不是滚动加载更多时插件加载的行。

Anyone experience this issue and know how to approach this. 任何人都会遇到此问题并知道如何处理此问题。

Thanks 谢谢

Since version 0.1.5 of IAS there is a new option called onRenderComplete , this is a callback function you can use to reinitialize other javascript code after new items have been added to the DOM. 从IAS版本0.1.5开始,有一个名为onRenderComplete的新选项,这是一个回调函数,可以在将新项目添加到DOM后重新初始化其他javascript代码。

You can read more about here: https://github.com/webcreate/infinite-ajax-scroll#onrendercomplete 您可以在这里阅读更多信息: https//github.com/webcreate/infinite-ajax-scroll#onrendercomplete

Basically you can put any code that lives in $(document).ready() into this callback. 基本上,您可以将$(document).ready()任何代码放入此回调中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM