(function($, window, document) { // 瀹氫箟鏋勯€犲嚱鏁 function Paging(el, options) { this.el = el; this.options = { pageNo: options.initPageNo || 1, // 鍒濆椤电爜 totalPages: options.totalPages || 1, //鎬婚〉鏁 totalCount: options.totalCount || '', // 鏉$洰鎬绘暟 slideSpeed: options.slideSpeed || 0, // 缂撳姩閫熷害 jump: options.jump || false, // 鏀寔璺宠浆 callback: options.callback || function() {} // 鍥炶皟鍑芥暟 }; this.init(); } // 缁欏疄渚嬪璞℃坊鍔犲叕鍏卞睘鎬у拰鏂规硶 Paging.prototype = { constructor: Paging, init: function() { this.createDom(); this.bindEvents(); }, createDom: function() { var that = this, ulDom = '', jumpDom = '', content = '', liWidth =38, // li鐨勫搴 totalPages = that.options.totalPages, // 鎬婚〉鏁 wrapLength = 0; totalPages > 5 ? wrapLength = 5 * liWidth : wrapLength = totalPages * liWidth; for (var i = 1; i <= that.options.totalPages; i++) { i != 0 ? ulDom += '
鍏?nbsp;' + that.options.totalPages + ' 椤袋/p>' + '
' + that.options.totalCount + '