<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                html核心代碼(主要給加載按鈕一個id為loadmore,給新聞列表一個id為xinhao) ~~~ <div class="pull-left product-content-body wow bounceInLeft" > <div id="xinhao"> {volist name="alist" id="vo" empty="暫無該類信息~~" } <dl class="news-ajax clearfix"> <dt> <a href="{:url('details')}?id={$vo.id}&kid={$Request.param.kid}"><img src="__ROOT__/uploads/news/{$vo.image}"/></a> </dt> <dd> <h2><a href="{:url('details')}?id={$vo.id}&kid={$Request.param.kid}">{$vo.title}</a></h2> <p>{$vo.desc|mb_substr=0,100}</p> <div class="inft-txt">{$vo.create_time|date="Y-m-d",###} 藍蝶</div> </dd> </dl> {/volist} </div> <div class="clearfix"></div> <div class="page-ajax"> <a class="loadmore" id="loadmore"><i></i>加載更多</button> </div> </div> ~~~ 操作器核心代碼(index方法,主要$alist與$count;data方法為核心方法) ~~~ class News extends Base { //新聞首頁 public function index() { $erjicaidan=db('news_cate')->order('sort desc,id asc')->select(); $alist=db('news')->order('sort desc,create_time desc')->limit(5)->select(); //獲取記錄數量 $count=db('news')->count(); $hotlist=Db::table('news')->order('pv desc')->limit(5)->select(); $this -> assign('alist',$alist); $this -> assign('count',$count); $this -> assign('hotlist',$hotlist); $this -> assign('erjicaidan',$erjicaidan); return $this->view->fetch('news/index'); } //加載更多 public function data() { $data = $this->request->param(); $start =$data['start']; $list = db('news')->limit($start, 5)->order('sort desc,create_time desc')->select(); return ['result'=>$list,'status'=>1, 'msg'=>'獲取成功!']; } } ~~~ js核心代碼 ~~~ {load href="/static/admin/js/jquery-1.11.1.min.js"/} <script> //加載更多 var nStart =5; var html=''; $('#loadmore').click(function() { var _this = $("#xinhao"); if(nStart >= {$count}) { //alert('后面沒有數據了!'); $("#loadmore").html('沒有數據了親...').css({"color":"666","height":"30px","line-height":"30px"}); } else { //alert('還有數據!'); $.post("{:url('news/data')}", {start:nStart}, function(res) { $.each(res.result, function(i, item) { _this.append('<dl class="news-ajax clearfix">\ <dt>\ <a href="/index/news/details/id/'+item.id+'/kid/4.html"><img src="__ROOT__/uploads/news/'+item.image+'"/></a>\ </dt>\ <dd>\ <h2><a href="/index/news/details/id/'+item.id+'/kid/4.html">'+item.title+'</a></h2>\ <p>'+item.title+'</p>\ <div class="inft-txt">'+item.title+'藍蝶</div>\ </dd>\ </dl>'); }); }); nStart += 5; } }); </script> ~~~ 參考文章 http://www.jb51.net/article/108108.htm
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看