milo的分頁元件的使用
阿新 • • 發佈:2018-11-08
步驟:
1.需要引入milo.js
2.手寫一個分頁的樣式
3.分頁html程式碼
4.分頁js程式碼
<script src="//ossweb-img.qq.com/images/js/mobile_bundle/milo.js"></script> <script> need("util.ajaxpage", function(jo) { pageShow = new jo({ oPage: "pageShow", pageId: "list_page",//對應html結構的分頁id pageNow: curPage, pageShowNum: 2, pageTotal: Math.ceil(data["total"] / 4), style: 3475, onChange: function(i) { // console.log(i) Base.test(i) //點選頁碼的回撥 } }); }); </script> //html結構 <div class="page-list" id="list_page"></div>