您如何在Blogger中制作无限滚动页面? [英] How do you make an infinite scroll page in Blogger?

查看:68
本文介绍了您如何在Blogger中制作无限滚动页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个博客,并希望使其无限滚动,因此您不必单击页面和帖子页面.有人可以根据 Blogger 用HTML格式的代码帮助我吗? 谢谢:-)

I have a blog and would like to make it infinite scroll so you don't have to click through pages and pages of posts. Can anyone help me with the code, its in HTML according to Blogger? Thanks :-)

推荐答案

如何向Blogger博客添加无限滚动

最近我读了一篇有趣的文章,如何向Blogger博客添加无限滚动.如果您使用的是Blogger的博客,则可以按照说明进行操作,并为您的博客提供一个无限滚动的页面,无需太多麻烦.

How to add infinite scrolling to Blogger blogs

Recently I read an interesting article, How to add infinite scrolling to Blogger blogs. If you are using Blogger's blog, you can follow the instructions and give your blog, an infinite scroll without much hassle.

可在 Google代码.随时复制或修改代码.

The code for the widget is available on Google Code. Feel free to copy or adapt the code.

在他们的网站中,几点值得一提:

From their website, a few points worth mentioning:

  • 此代码使用 jQuery库,因此请不要忘记包含它.
  • 自定义模板博客可能必须更改代码中的postContainerSelector变量的值.
  • 您已将 +1按钮手动添加到我的博客中.动态加载的帖子不会初始化+1按钮;要解决此问题,每次将新帖子添加到页面时,我都必须致电gapi.plusone.go().
  • _WidgetManager是Blogger博客中存在的JavaScript对象.您可以查询该对象以找到一些页面元数据.此代码使用_WidgetManager确定当前页面是否显示单个帖子.当只需要显示一个帖子时,无限滚动是没有意义的.
  • 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中制作无限滚动页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆