Instafeed插件“加载更多”按钮不工作

Instafeed plugin Load More button is not working

本文关键字:按钮 工作 加载更多 插件 加载 Instafeed      更新时间:2023-09-26

我正在使用instafeed js插件,并试图使用加载更多按钮,但它不起作用。我在这里看到了一个有同样问题的帖子,但很抱歉仍然不适合我。有什么帮助吗?谢谢

这是我的代码

         var feed = new Instafeed({
        get: 'user',
        userId: 300087,
        accessToken: '300087.467ede5.6af355f8b6c048b2bbfc6772ab918cf9',
        link: 'true',
        resolution: 'standard_resolution',
        limit: '20'
        });
        // call feed.next() on button click
         $('#load-more').on('click', function() {
         feed.next();
         });
        // run our feed!
         feed.run();

以及在html页面中

          <a id="load-more">load more</a>

您需要将'after'段添加到提要变量中

after: function() {
    if (!this.hasNext()) {
        moreButton.hide();
    }
}