发布日期: 2024-05-09 | 来源: 智软设计工作室
pbootcms实现瀑布流“ajax加载更多”“无限下拉”分页调用列表,
,支持动静态
,支持图片延迟加载
1、页面中引用jquery.js 与 jquery-ias.min.js
注意:jquery.js库版本必须大于1.6
<script src='/js/jquery.js'></script> <script src="/js/jquery-ias.min.js"></script>
2、接着上面的js,在页面中写上插件参数
<script type="text/javascript">
var ias = $.ias({
container: ".listbox", //包含所有文章的元素
item: ".item", //文章元素
pagination: ".pagelist", //分页元素
next: ".pagelist a.nextpage", //下一页元素
});
ias.extension(new IASSpinnerExtension({
src: "/img/load.gif", //此选项为加载时缓冲图片
html: '<p style="text-align: center;"><img src="{src}"/></p>'
}));
ias.extension(new IASTriggerExtension({
text: '点击加载更多', //此选项为需要点击时的文字
html: '<p style="text-align: center; cursor: pointer;"><a>{text}</a></p>',
offset: !1, //设置此项,如 offset:2 页之后需要手动点击才能加载,offset:!1 则一直为无限加载
}));
ias.extension(new IASNoneLeftExtension({
text: '已经加载完成!', // 加载完成时的提示
html: '<p style="text-align: center; cursor: pointer;"><a>{text}</a></p>',
}));
</script>3、pbootcms列表模板html代码示范,注意html代码中的 listbox、item、pagelist、nextpage 要与上面js中的统一。
<!-- listbox这个必须包住分页条在里面 -->
<div class="listbox">
<ul>
{pboot:list num='10'}
<li class="item"><a href="[list:link]" class="title">[list:title]</a></li>
{/pboot:list}
</ul>
<ul class="pagelist">
{pboot:if('{page:current}'=='{page:count}')}
<!--weiye-->
{else}
<a class="nextpage" href="{page:next}">下一页</a>
{/pboot:if}
</ul>
</div>4、要在加载更多后显示的文章中支持图片延迟加载,需要添加此图片延迟加载功能,
ias.on('rendered', function(items) {
$(".content img").lazyload({
effect: "fadeIn",
failure_limit : 10
}); //这里是你调用Lazyload的代码
})2023-07-31
{pboot:if('{content:ispics}'=='0')}{content:ico}{else}{pboot:picsnum=1id={content:id}}[pics:src]{/pboot:pics}{/pboot:if}其他得代码在去拓展
阅读更多2023-05-09
css字体渐变颜色background-image:-webkit-linear-gradient(bottom,#fb1919,#fd8403,#75751e);-webkit-background-clip:text;-webkit-text-fill-color:transparent;这里要注意。如果设置了这个。css字体移动样式也要设置。不然普通字体移动变色。没有效果,css背景渐变颜色代码如下:background-image: linear-gradient(140d
阅读更多2021-11-24
SQLite 查询本月的数据select *from ay_diy_jingxiaoshangwhere create_time between datetime('now','start of month','+1 second') anddatetime('now','start of month','+1 month','-1 second')查询多少天之内的数据,查询365天select *from ay_di
阅读更多2022-07-15
tags关联文章{content:tags}{pboot:if('{content:tags}'=='')} 空{else}手册:{pboot:list scode=40 tags={content:tags}}<p><a href="[list:link]">[list:title]</a></p>{/pboot:list}常见问题:{pboot:list scode=41 tags={content:tags}}<
阅读更多2026-09-11
ParserModel.php 的`getList()` 默认 SELECT 字段列表漏了`a.tags` ,加上就行了
阅读更多2024-12-23
pbootcms 上传的图片自动转换webp下面是修改过的文件。直接替换\core\function目录里的file.php文件.rar这里就不贴修改了。
阅读更多2021-11-11
激活步骤:1.如下图,以管理员运行;2.输入:123slmgr /ipk WC2BQ-8NRM3-FDDYY-2BFGV-KHKQYslmgr /skms kms.03k.orgslmgr /ato
阅读更多2025-03-11
事情是这样的。我在windows环境测试都是后的。然后转移到linux环境。出现一个问题,就是有一个栏目要登陆后才能查看。但是他没有跳转。直接出现404,一开始以为是伪静态的问题。但是排查了下。不是这个问题,然后就找了下 出现这个错误的代码,具体修改是。注销这个自定义跳转到404代码。当调用出现问题或者数据库字段不一致
阅读更多2022-05-19
PbootCMS栏目页 详情页获取顶级栏目大图,这样不用每个子类都设置栏目大图banner{pboot:sort scode={sort:tcode}}<div class="nybanner"><img src="[sort:pic]" alt="[sort:name]"/></div>{/pboot:sort}
阅读更多