带有addthis按钮的无限滚动

El *_*oso 2 ajax scroll infinite addthis

我正在我的页面上运行一些测试,我已经输入了无限滚动功能,女巫工作正常.

问题是addthis按钮在10º结果之后没有加载到页面结尾,因为这个内容来自另一个php.我需要在php或.js文件中放入什么才能使其正常工作?

测试页面是这个http://hogardelocio.com/teste2.php,你可以看到,前10篇文章是完美的,向下滚动页面,它将加载更多的文章,但按钮不显示...

请给我一步一步的解释因为我在ajax世界的初学者:)

谢谢

Ps:无限卷轴的脚本是这个https://github.com/tournasdim/PHP-infinite-scrolling

Sol*_*Sol 5

通过ajax从PHP脚本加载内容后,需要调用addthis.toolbox()(在$ .ajax成功回调中):

$.ajax({
    dataType : "html" ,
    url: "jquery-loadMoreComments.php?lastComment="+ $(".postedComment:last").attr('id') ,  
    success: function(html) {
        // your existing code
        addthis.toolbox('.addthis_toolbox');
    }
};
Run Code Online (Sandbox Code Playgroud)

这应该重新呈现页面上的所有共享按钮.我希望这有效.

更新 - 将类名添加到工具箱方法