将内容添加到无限滚动之前
好的,所以我正在为一个项目使用 WordPress 无限滚动插件:
http://www.infinite-scroll。 com/
一切正常,但我希望在每个页面之前加载一个 div,其中包含页码和指向网站顶部的锚链接。我在 php 方面尝试了很多东西,但这个插件似乎会抓取各个帖子,因此我添加的任何内容都会发布到每个帖子,而不是页面顶部。所以我转到 javascript 端并寻找加载内容的点,以便我可以在其前面添加一个 div。
我很确定这就是这一行:
box.load(path.join( props.currPage ) + ' ' + opts.itemSelector,null,loadCallback);
Is there any way to prepend some html to the .load() method?
对此的任何帮助将不胜感激。
Ok, so I'm using the wordpress infinite scroll plugin for a project:
http://www.infinite-scroll.com/
Everything works fine, but I would like to have a div loaded before each page with the page number and an anchor link to the top of the site. I tried a bunch of things on the php side, but this plugin seems to grab individual posts, so any content that I add gets posted to every single post, and not the top of the page. So I went to the javascript side and am looking for the point where the content is loaded so I can prepend a div to it.
I'm pretty sure this is the line:
box.load(path.join( props.currPage ) + ' ' + opts.itemSelector,null,loadCallback);
Is there any way to prepend some html to the .load() method?
Any help on this would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找回调方法。
You're looking for the callback method.