我有一个博客,希望使其无限滚动,这样您就不必点击页面和帖子页面。任何人都可以帮助我编写代码(根据 Blogger 的 HTML 格式)吗? 谢谢:-)
最佳答案
如何向 Blogger 博客添加无限滚动
最近读到一篇有趣的文章,How to add infinite scrolling to Blogger blogs 。如果您正在使用 Blogger 的博客,您可以按照说明操作,让您的博客无限滚动,无需太多麻烦。
小部件的代码可在 Google Code 上找到。 。请随意复制或改编代码。
来自他们的website ,有几点值得一提:
- This code uses jQuery library, so don’t forget to include it.
- Custom template blogs may have to change the value of
postContainerSelector
variable in the code.- You have manually added +1 buttons to my blog. Dynamically loaded posts won’t have the +1 buttons initialised; to fix that issue, I had to call
gapi.plusone.go()
every time new posts are added to the page._WidgetManager
is a JavaScript object present in Blogger blogs. You can query this object to find some page metadata. This code uses_WidgetManager
to determine if the current page is showing a single post. Infinite scrolling is not meaningful when only a single post needs to be displayed.
关于blogger - 如何在 Blogger 中制作无限滚动页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12872070/