分页插件

作者: MWY | 来源:发表于2017-03-01 09:38 被阅读53次

    一个很好看的分页插件

    Screen Shot 2017-03-01 at 09.26.01.png
    Example
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <link rel="stylesheet" href="../src/paginator/css/paginator.css">
    </head>
    <body>
    
    <div id="paginator" class="paginator">
    
    </div>
    
    
    <script src="../src/paginator/js/jquery.min.js"></script>
    <script src="../src/paginator/js/paginator.js"></script>
    <script>
        $(function () {
            var s = $('#cur').val();
            console.log(s);
            paginator.generPageHtml({
                //当前页
                pno :1,
                //总页码
                total :100,
                //总数据条数
                totalRecords : 1000,
                //链接前部
                hrefFormer : '',
                //链接尾部
                hrefLatter : '',
                //链接算法
                getLink : function(n){
                    if(n == 1){
                        return this.hrefFormer + this.hrefLatter;
                    }
                    return this.hrefFormer  + '#' + this.hrefLatter;
                }
    
            });
        })
    </script>
    
    </body>
    </html>
    

    相关文章

      网友评论

        本文标题:分页插件

        本文链接:https://www.haomeiwen.com/subject/umkqgttx.html