请问一下我的分页为什么出不来呢?谢谢

浏览:883 发布日期:2017/01/11 分类:求助交流
{template 'common/header-gw'}

    <style>
        .account-rank img{width:20px; height:20px;}
        .alert{color:#666;padding:10px}
        .text-strong{font-size:14px;font-weight:bold;}
        .popover{max-width: 450px}
        .popover-content{padding-top: 0;line-height: 30px}
        .popover-content h5{padding-bottom: 5px}
        .wrap_left{float:left;width:250px;}
        .wrap_right{float:left;height:auto;min-width:70vw;max-width:80vw;}
        .wrap_right .content{max-width:1550px;}
        .table-striped{width:70vw;}
        p{margin:0}
            #page{
                height:40px;
                padding:20px 0px;
            }
            #page a{
                display:block;
                float:left;
                margin-right:10px;
                padding:2px 12px;
                height:24px;
                border:1px #cccccc solid;
                background:#fff;
                text-decoration:none;
                color:#808080;
                font-size:12px;
                line-height:24px;
            }
            #page a:hover{
                color:#077ee3;
                border:1px #077ee3 solid;
            }
            #page a.cur{
                border:none;
                background:#077ee3;
                color:#fff;
            }
            #page p{
                float:left;
                padding:2px 12px;
                font-size:12px;
                height:24px;
                line-height:24px;
                color:#bbb;
                border:1px #ccc solid;
                background:#fcfcfc;
                margin-right:8px;

            }
            #page p.pageRemark{
                border-style:none;
                background:none;
                margin-right:0px;
                padding:4px 0px;
                color:#000;
            }
            #page p.pageRemark b{
                /*color:red;*/
            }
            #page p.pageEllipsis{
                border-style:none;
                background:none;
                padding:4px 0px;
                color:#808080;
            }
            .dates li {font-size: 14px;margin:20px 0}
            .dates li span{float:right}
            
            .jPaginate{
    height:34px;
    position:relative;
    color:#a5a5a5;
    font-size:small;   
    width:100%;
}
.jPaginate a{
    line-height:15px;
    height:18px;
    cursor:pointer;
    padding:2px 5px;
    margin:2px;
    float:left;
}
.jPag-control-back{
    position:absolute;
    left:0px;
}
.jPag-control-front{
    position:absolute;
    top:0px;
}
.jPaginate span{
    cursor:pointer;
}
ul.jPag-pages{
    float:left;
    list-style-type:none;
    margin:0px 0px 0px 0px;
    padding:0px;
}
ul.jPag-pages li{
    display:inline;
    float:left;
    padding:0px;
    margin:0px;
}
ul.jPag-pages li a{
    float:left;
    padding:2px 5px;
}
span.jPag-current{
    cursor:default;
    font-weight:normal;
    line-height:15px;
    height:18px;
    padding:2px 5px;
    margin:2px;
    float:left;
}
ul.jPag-pages li span.jPag-previous,
ul.jPag-pages li span.jPag-next,
span.jPag-sprevious,
span.jPag-snext,
ul.jPag-pages li span.jPag-previous-img,
ul.jPag-pages li span.jPag-next-img,
span.jPag-sprevious-img,
span.jPag-snext-img{
    height:22px;
    margin:2px;
    float:left;
    line-height:18px;
}

ul.jPag-pages li span.jPag-previous,
ul.jPag-pages li span.jPag-previous-img{
    margin:2px 0px 2px 2px;
    font-size:12px;
    font-weight:bold;
        width:10px;

}
ul.jPag-pages li span.jPag-next,
ul.jPag-pages li span.jPag-next-img{
    margin:2px 2px 2px 0px;
    font-size:12px;
    font-weight:bold;
    width:10px;
}
span.jPag-sprevious,
span.jPag-sprevious-img{
    margin:2px 0px 2px 2px;
    font-size:18px;
    width:15px;
    text-align:right;
}
span.jPag-snext,
span.jPag-snext-img{
    margin:2px 2px 2px 0px;
    font-size:18px;
    width:15px;
     text-align:right;
}
ul.jPag-pages li span.jPag-previous-img{
    background:transparent url(../images/previous.png) no-repeat center right;
            }
ul.jPag-pages li span.jPag-next-img{
    background:transparent url(../images/next.png) no-repeat center left;
            }
span.jPag-sprevious-img{
    background:transparent url(../images/sprevious.png) no-repeat center right;
            }
span.jPag-snext-img{
    background:transparent url(../images/snext.png) no-repeat center left;
            }

#page_title{height:32px; line-height:32px; text-align:center}
.demo{width:500px; margin:10px auto}
.demo h4{height:24px; line-height:24px; font-size:14px}
.pagetxtjzc{ height:160px; border:1px solid #999; padding:4px;}
.pagetxtjzc p{line-height:24px; font-size:14px}
.pagetxtjzc p span{float:right; color:#999}
            
    </style>
    <ol class="breadcrumb">
        <li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
        <li><a href="{url 'system/welcome'}">系统</a></li>
        <li class="active">官网管理</li>
        <li class="active">论坛主题管理</li>
        <li class="active">论坛主题列表</li>
    </ol>
    <div class="clearfix" style="margin-bottom:5em;">
    
        <div class='wrap_left'>
            {template 'common/left-mobileclient'}
        </div>
        
        <div class='wrap_right'>
            <div class='content'>
            
                    
                    
                    <table class="table table-striped table_lajidai"  border="0">
                        <thead>
                            <tr>
                                <td style='width:20%;'>
                                    <div> 
                                        <h5>论坛主题列表</h5> 
                                    </div>
                                </td>                            
                                <td style='width:35%;'> </td>
                                <td style='width:15%;'> </td>                                
                                <td style='width:15%;'> </td>
                                <td style='width:15%;'> </td>
                            </tr>
                        </thead>
                        <tr>
                            <td style="width:20px !important;">序号</td>
                            <td>标题</td>
                            <td>作者</td>                            
                            <td>创建时间</td>
                            <td>操作</td>
                        </tr>
                        {loop $article $val}
                        <tr>
                            <td>{$val['rowno']}</td>
                            <td>{$val['title']}</td>
                            <td>{$val['bbsuser_name']}</td>                            
                            <td>{$val['ctime']}</td>
                            <td>
                                <a href="{$_W['siteroot']}web/index.php?c=mobileclient&a=luntanzhutiDetail&id={$val['id']}" ><button class='view btn btn-primary' opratid="{$val['id']}" >查看</button></a>
                                <a href='javascript:;' ><button class='del_luntanzhuti btn btn-danger' opratid="{$val['id']}" >删除</button></a>
                            </td>
                        </tr>
                        {/loop}
                        <tr>
                        <td colspan="8" class="td_fenye">
                            <div class="pagetxtjzc" style="border:1px solid;height:50px;">
                            
                            </div>
                            <div class="demo3" style="border:1px solid;height:50px;></div>
                        </td>
                        </tr>
                    </table>
                    
                    
    
    <input type='hidden' id='luntanzhuti_delurl' value='{$_W["siteroot"]}web/index.php?c=mobileclient&a=luntanzhutiDel'>
    
            </div>
            
        </div>
        
    </div>
    
<script type="text/javascript">
$(".del_luntanzhuti").click(function(){
    var opratid = $(this).attr('opratid');    
    var delurl = $('#luntanzhuti_delurl').val();
    var data = 'id=' + opratid;//操作的是新闻
    var txt=  "确定要删除这条记录吗?";    
    var option = {
        title: "温馨提示",
        btn: parseInt("0011",2),
        onOk: function(){
            $.post( delurl, data, function( res ){
                if(res.status==1){
                    var txt2 = "此条记录删除成功!";
                    var option2 = {
                        title: "删除成功!",
                        btn: parseInt("0011",2),
                        onOk: function(){                            
                            window.location.href= window.location.href;
                        }
                    }
                    window.wxc.xcConfirm(txt2, "custom", option2);    
                }                
            });
        }
        
    }
    window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.warning, option);    
});





</script>

<script type="text/javascript">
var search = window.location.href;
//alert(search);
$(function(){    
    var pageurl="{$_W['siteroot']}web/index.php?c=mobileclient&a=luntanzhuti";
    $(".demo3").paginate({
                count         : <?php echo $page; ?>,
                start         : 1,
                display     : 5,
                border                    : true,
                border_color            : '#BEF8B8',
                text_color              : '#79B5E3',
                background_color        : '#E3F2E1',    
                border_hover_color        : '#68BA64',
                text_hover_color          : '#2573AF',
                background_hover_color    : '#CAE6C6', 
                images                    : false,
                mouse                    : 'press',
                onChange                 : function(page){
                                            $(".pagetxtjzc").reload();
                                            //$(".td_fenye").html("<div class='pagetxtjzc' style='height:50px;'><div class='demo3'></div>");
                                            //$("document").load(search+"&id="+page,function(){
                                                //$("body").eq(2).hide();
                                                $(".demo3").show();
                                            });
                                            
                                          }
    });
    $(".pagetxtjzc").ajaxSend(function(event, request, settings){
        $(this).html("<img src='loading.gif' /> 正在读取。。。");
    });
});
</script>

<script>
(function($) {
    $.fn.paginate = function(options) {
        var opts = $.extend({}, $.fn.paginate.defaults, options);
        return this.each(function() {
            $this = $(this);
            var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
            var selectedpage = o.start;
            $.fn.draw(o,$this,selectedpage);    
        });
    };
    var outsidewidth_tmp = 0;
    var insidewidth      = 0;
    var bName = navigator.appName;
    var bVer = navigator.appVersion;
    if(bVer.indexOf('MSIE 7.0') > 0)
        var ver = "ie7";
    $.fn.paginate.defaults = {
        count         : 5,
        start         : 12,
        display      : 5,
        border                    : true,
        border_color            : '#fff',
        text_color              : '#8cc59d',
        background_color        : 'black',    
        border_hover_color        : '#fff',
        text_hover_color          : '#fff',
        background_hover_color    : '#fff', 
        rotate                  : true,
        images                    : true,
        mouse                    : 'slide',
        onChange                : function(){return false;}
    };
    $.fn.draw = function(o,obj,selectedpage){
        $this.empty();
        if(o.images){
            var spreviousclass     = 'jPag-sprevious-img';
            var previousclass     = 'jPag-previous-img';
            var snextclass         = 'jPag-snext-img';
            var nextclass         = 'jPag-next-img';
        }
        else{
            var spreviousclass     = 'jPag-sprevious';
            var previousclass     = 'jPag-previous';
            var snextclass         = 'jPag-snext';
            var nextclass         = 'jPag-next';
        }
        var _first        = $(document.createElement('a')).addClass('jPag-first').html('\u9996\u9875');
        
        if(o.rotate){
            if(o.images) var _rotleft    = $(document.createElement('span')).addClass(spreviousclass);
            else var _rotleft    = $(document.createElement('span')).addClass(spreviousclass).html('«');        
        }
        
        var _divwrapleft    = $(document.createElement('div')).addClass('jPag-control-back');
        _divwrapleft.append(_first).append(_rotleft);
        
        var _ulwrapdiv    = $(document.createElement('div')).css('overflow','hidden');
        var _ul            = $(document.createElement('ul')).addClass('jPag-pages')
        var c = (o.display - 1) / 2;
        var first = selectedpage - c;
        var selobj;
        for(var i = 0; i < o.count; i++){
            var val = i+1;
            if(val == selectedpage){
                var _obj = $(document.createElement('li')).html('<span class="jPag-current">'+val+'</span>');
                selobj = _obj;
                _ul.append(_obj);
            }    
            else{
                var _obj = $(document.createElement('li')).html('<a>'+ val +'</a>');
                _ul.append(_obj);
                }                
        }        
        _ulwrapdiv.append(_ul);
        
        if(o.rotate){
            if(o.images) var _rotright    = $(document.createElement('span')).addClass(snextclass);
            else var _rotright    = $(document.createElement('span')).addClass(snextclass).html('»');
        }
        
        var _last        = $(document.createElement('a')).addClass('jPag-last').html('\u5c3e\u9875');
        var _divwrapright    = $(document.createElement('div')).addClass('jPag-control-front');
        _divwrapright.append(_rotright).append(_last);
        
        //append all:
        $this.addClass('jPaginate').append(_divwrapleft).append(_ulwrapdiv).append(_divwrapright);
            
        if(!o.border){
            if(o.background_color == 'none') var a_css                 = {'color':o.text_color};
            else var a_css                                             = {'color':o.text_color,'background-color':o.background_color};
            if(o.background_hover_color == 'none')    var hover_css     = {'color':o.text_hover_color};
            else var hover_css                                         = {'color':o.text_hover_color,'background-color':o.background_hover_color};    
        }    
        else{
            if(o.background_color == 'none') var a_css                 = {'color':o.text_color,'border':'1px solid '+o.border_color};
            else var a_css                                             = {'color':o.text_color,'background-color':o.background_color,'border':'1px solid '+o.border_color};
            if(o.background_hover_color == 'none')    var hover_css     = {'color':o.text_hover_color,'border':'1px solid '+o.border_hover_color};
            else var hover_css                                         = {'color':o.text_hover_color,'background-color':o.background_hover_color,'border':'1px solid '+o.border_hover_color};
        }
        
        $.fn.applystyle(o,$this,a_css,hover_css,_first,_ul,_ulwrapdiv,_divwrapright);
        //calculate width of the ones displayed:
        var outsidewidth = outsidewidth_tmp - _first.parent().width() -3;
        if(ver == 'ie7'){
            _ulwrapdiv.css('width',outsidewidth+72+'px');
            _divwrapright.css('left',outsidewidth_tmp+6+72+'px');
        }
        else{
            _ulwrapdiv.css('width',outsidewidth+'px');
            _divwrapright.css('left',outsidewidth_tmp+6+'px');
        }
        
        if(o.rotate){
            _rotright.hover(
                function() {
                  thumbs_scroll_interval = setInterval(
                    function() {
                      var left = _ulwrapdiv.scrollLeft() + 1;
                      _ulwrapdiv.scrollLeft(left);
                    },
                    20
                  );
                },
                function() {
                  clearInterval(thumbs_scroll_interval);
                }
            );
            _rotleft.hover(
                function() {
                  thumbs_scroll_interval = setInterval(
                    function() {
                      var left = _ulwrapdiv.scrollLeft() - 1;
                      _ulwrapdiv.scrollLeft(left);
                    },
                    20
                  );
                },
                function() {
                  clearInterval(thumbs_scroll_interval);
                }
            );
            if(o.mouse == 'press'){
                _rotright.mousedown(
                    function() {
                      thumbs_mouse_interval = setInterval(
                        function() {
                          var left = _ulwrapdiv.scrollLeft() + 5;
                          _ulwrapdiv.scrollLeft(left);
                        },
                        20
                      );
                    }
                ).mouseup(
                    function() {
                      clearInterval(thumbs_mouse_interval);
                    }
                );
                _rotleft.mousedown(
                    function() {
                      thumbs_mouse_interval = setInterval(
                        function() {
                          var left = _ulwrapdiv.scrollLeft() - 5;
                          _ulwrapdiv.scrollLeft(left);
                        },
                        20
                      );
                    }
                ).mouseup(
                    function() {
                      clearInterval(thumbs_mouse_interval);
                    }
                );
            }
            else{
                _rotleft.click(function(e){
                    var width = outsidewidth - 10;
                    var left = _ulwrapdiv.scrollLeft() - width;
                    _ulwrapdiv.animate({scrollLeft: left +'px'});
                });    
                
                _rotright.click(function(e){
                    var width = outsidewidth - 10;
                    var left = _ulwrapdiv.scrollLeft() + width;
                    _ulwrapdiv.animate({scrollLeft: left +'px'});
                });
            }
        }
        
        //first and last:
        _first.click(function(e){
                _ulwrapdiv.animate({scrollLeft: '0px'});
                _ulwrapdiv.find('li').eq(0).click();
        });
        _last.click(function(e){
                _ulwrapdiv.animate({scrollLeft: insidewidth +'px'});
                _ulwrapdiv.find('li').eq(o.count - 1).click();
        });
        
        //click a page
        _ulwrapdiv.find('li').click(function(e){
            selobj.html('<a>'+selobj.find('.jPag-current').html()+'</a>'); 
            var currval = $(this).find('a').html();
            $(this).html('<span class="jPag-current">'+currval+'</span>');
            selobj = $(this);
            $.fn.applystyle(o,$(this).parent().parent().parent(),a_css,hover_css,_first,_ul,_ulwrapdiv,_divwrapright);    
            var left = (this.offsetLeft) / 2;
            var left2 = _ulwrapdiv.scrollLeft() + left;
            var tmp = left - (outsidewidth / 2);
            if(ver == 'ie7')
                _ulwrapdiv.animate({scrollLeft: left + tmp - _first.parent().width() + 52 + 'px'});    
            else
                _ulwrapdiv.animate({scrollLeft: left + tmp - _first.parent().width() + 'px'});    
            o.onChange(currval);    
        });
        
        var last = _ulwrapdiv.find('li').eq(o.start-1);
        last.attr('id','tmp');
        var left = document.getElementById('tmp').offsetLeft / 2;
        last.removeAttr('id');
        var tmp = left - (outsidewidth / 2);
        if(ver == 'ie7') _ulwrapdiv.animate({scrollLeft: left + tmp - _first.parent().width() + 52 + 'px'});    
        else _ulwrapdiv.animate({scrollLeft: left + tmp - _first.parent().width() + 'px'});    
    }
    
    $.fn.applystyle = function(o,obj,a_css,hover_css,_first,_ul,_ulwrapdiv,_divwrapright){
                    obj.find('a').css(a_css);
                    obj.find('span.jPag-current').css(hover_css);
                    obj.find('a').hover(
                    function(){
                        $(this).css(hover_css);
                    },
                    function(){
                        $(this).css(a_css);
                    }
                    );
                    obj.css('padding-left',_first.parent().width() + 5 +'px');
                    insidewidth = 0;
                    
                    obj.find('li').each(function(i,n){
                        if(i == (o.display-1)){
                            outsidewidth_tmp = this.offsetLeft + this.offsetWidth ;
                        }
                        insidewidth += this.offsetWidth;
                    })
                    _ul.css('width',insidewidth+'px');
    }
})(jQuery);
</script>
{template 'common/footer-gw'}

附件 QQ图片20170111110731.png ( 223.05 KB 下载:3 次 )

最佳答案
评论( 相关
后面还有条评论,点击查看>>