js分页插件layPage使用笔记

1.说明

1.官网 http://www.layui.com/demo/laypage.html

2.example

1.引入JS和CSS文件

<link rel="stylesheet" type="text/css" href="layui/css/layui.css">
<script type="text/javascript" src="layui/layui.all.js"></script>
<!--这里换成你的路径-->

2.html代码

<div id="page"></div>

3.js代码

layui.use(['laypage', 'layer'], function(){
        var laypage = layui.laypage
         laypage.render({
            elem: 'page', //填你DIV的ID
            theme: '#6699ff', //颜色
            limit:10, //一页的条数,默认为10
            count: 100, //数据总数
            //触发换页操作
            jump: function(obj){                
                console.log("code you code");       
            }
        });
    });

猜你喜欢

转载自blog.csdn.net/qq_32475739/article/details/79100180