jPages.min.js使用
<style>
.holder a:hover{color:#af1e25}
.holder a.jp-previous{margin-right:15px}
.holder a.jp-next{margin-left:15px}
.holder a.jp-current,a.jp-current:hover{background:#af1e25!important;border-color:#af1e25!important;color:#fff!important}
.holder a.jp-disabled,a.jp-disabled:hover{color:#bbb}
.holder a.jp-current,.holder a.jp-disabled,a.jp-current:hover,a.jp-disabled:hover{cursor:default}
.holder span{margin:0 5px}
.holder{display:flex;justify-content:center;flex-wrap:wrap;margin-right:10px}
.upage{display:flex;justify-content:center;flex-wrap:wrap;margin-top:40px}
.pgtool{display:flex;justify-content:center;flex-wrap:wrap}
.upage .pg1{line-height:30px;font-size:14px;color:#666}
.upage .pg2{display:none}
.pginp{height:30px;width:60px;border:1px solid #ddd;border-radius:3px;margin:0 5px;outline:0;text-align:center;-webkit-appearance:none}
#pgGo{background:#af1e25;height:30px;padding:0 10px;border:0;border-radius:3px;color:#fff;outline:0;cursor:pointer}
/style>
function list(data) {
var nopic = "/ggsydw/nopic.jpg";
var html = "";
data.forEach(function (item, index) {
if (/cnsq.*shtml|shtml.*cnsq/.test(item.url)) {
item.url = "";
}
html += `<li><div class="img"><img class="lazy" data-original="${item.img ? item.img : nopic}" alt=""></div><div><div class="txt"><h4>${item.title}</h4>
<div class="info"><p><strong>机构性质:</strong><span>${item.jgxz}</span></p><p><strong>联系方式:</strong><span>${item.lxfs}</span></p><p><strong>地址:</strong><span>${item.dz}</span></p></div></div><div class="info1"><a href="${item.url ? item.url : "javascript:;"}" target="${item.url ? "_blank" : "_self"}"><img src="/cnsq/xhtml/ztzl/ggsydw/wz.png">官网</a><a href="javascript:;"><img src="/cnsq/xhtml/ztzl/ggsydw/wx.png">微信<span><img src="${item.code}" alt=""></span></a></div></div></li>`;
});
if (data.length != 0) {
$("#data").html(html);
$(".holder").jPages({
containerID: "data",
perPage: 12,
first: "首页",
previous: "上一页",
next: "下一页",
last: "尾页",
callback: function (pages, items) {
$("#legend1").html("当前 " + pages.current + " / " + pages.count + " 共" + items.count + "条记录");
$("img.lazy").lazyload({ effect: "fadeIn" });
},
});
$("#pgGo").click(function () {
var page = parseInt($(".pginp").val());
$(".holder").jPages(page);
});
$(".notip").hide();
} else {
$("#data").html("");
$(".holder").html("");
$(".notip").show();
}
}
需要先登录才能查看附件。