根据业务定制的一个本地分页插件
来源:互联网 发布:mts钢结构设计软件 编辑:程序博客网 时间:2024/05/29 02:04
<!-- 展示层 --><div class="my-gift pull-down-cont" id="showMyGiftContent" style="width:310px;display: none;background:#fff;font-size:16px;zoom:2;"> <h3> 我的奖品 <a style="float:right; font-weight: inherit;margin-right: 9px;font: 30px/30px \5b8b\4f53,tahoma,arial;text-decoration: none; color:#000" href="javascript:showDialog.hide();">×</a> </h3> <ul style="margin: 8px 26px 6px 0;list-style: none;padding: 0;"> <li style="line-height: 25px;margin-top: 8px;height: 29px;border-bottom: 1px dashed #219AFC;"> <span style="font-weight:bold;">获奖时间</span> <span style="font-weight:bold;padding-left:112px;">所获礼包</span> </li> </ul> <ul id="getGiftContent" style="margin: 8px 0 10px 0;list-style: none;padding: 0;"> </ul></div>
(function (w) { w.giftPageShow = null; w.giftPageShow = function (config) { var PageTool = { config: function (configObj) { for (var name in configObj) { if (typeof this.page[name] != 'undefined') { this.page[name] = configObj[name]; } else { this[name] = configObj[name]; } } }, page: { giftList: null, curGifts: null, total: 0, size: 8, pageNum: 1, curPage: 1, prevPage: 0, nextPage: 0, toEnd: false }, init: function (myGiftList) { this.page.giftList = myGiftList; this.page.total = len = myGiftList.length; this.page.pageNum = Math.ceil(this.page.total / this.page.size); $('#' + this.prev).on('click', this.prevEvent(this)); $('#' + this.next).on('click', this.nextEvent(this)); this.page.curGifts = this.page.giftList.slice(0, this.page.size); this.render(this.page.curGifts); }, prevEvent: function (_this) { return function () { if (_this.page.curPage == 1) { return false; } _this.page.curPage--; var start = (_this.page.curPage - 1) * _this.page.size; _this.page.curGifts = _this.page.giftList.slice(start, start + _this.page.size); _this.render(_this.page.curGifts); } }, nextEvent: function (_this) { return function () { if (_this.toEnd) { return false; } if ((_this.page.curPage + 1) > _this.page.pageNum) { _this.toEnd = true; return false; } _this.page.toEnd = false; var start = _this.page.curPage * _this.page.size; _this.page.curGifts = _this.page.giftList.slice(start, start + _this.page.size); _this.page.curPage++; _this.render(_this.page.curGifts); } }, render: function (myGiftList) { var giftT = ''; var len = myGiftList.length; if (len) { for (var i = 0; i < len; i++) { if (myGiftList.length) { giftT += ' <li style="line-height: 25px;margin-top: 4px;min-height: 27px;border-bottom: 1px dashed #219AFC;">' + '<span style="font-size:14px;" class="getTime">' + myGiftList[i].dtGetPackageTime + '</span> ' + '<span style="font-size:14px;" class="packageName"> ' + myGiftList[i].sPackageName + '</span> </li>'; } } } else { giftT += '<li style="line-height: 40px;margin-top: 8px;height: 50px;border-bottom: 1px dashed #219AFC;"> 亲,您还没有奖品!继续加油 </li>'; } $('#' + this.containerId).empty(); $('#' + this.containerId).append(giftT); need("biz.dialog", function (Dialog) { Dialog.show({id: 'showMyGiftContent', bgcolor: '#000', opacity: 50}); }); } } PageTool.config(config); PageTool.init(config.giftList); }})(window);
//使用方法
giftPageShow({ giftList: res.myGiftList, containerId: "getGiftContent", width: 300, prev: "pageprenone", next: "pagenextnone", size: 8});
0 0
- 根据业务定制的一个本地分页插件
- 可根据需求定制的jquery分页
- Mybatis的一个分页插件
- 一个分页的小插件
- 改写Jquery的一个分页插件
- 改写Jquery的一个分页插件
- 用Jquery写的一个分页插件
- 一个分页插件的源码分析
- 很强大的一个jquery分页插件
- Mybatis一个分页插件
- 分享一个jQuery分页插件,一个Bootstrap风格的分页插件
- 解除手机莫明其妙定制的短信业务
- 简单可定制业务的线程类
- 一个可以根据自己的要求定制滚动条的网站
- 根据业务需求写了一个继承的构造函数,分享出来
- 定制的一个仪表盘
- Datatables--一个有意思的自动分页和排序的插件
- 自己写的一个php分页类,支持onclick和详细定制参数
- 好用的分类统计--Python
- studio2.0+ndk-r11 中jni编译问题
- 为什么time()函数要返回1970年1月1日00点00分00秒开始到现在的秒数
- 剑指offer 26题 【分解让复杂问题简单】复杂链表的复制
- 统计字符串中有‘0’——‘9’的字符个数
- 根据业务定制的一个本地分页插件
- ActiveMQ的简单使用
- 丑数
- GP学习(三)—How to run a geoprocessing tool
- 1/4像素运动估计
- TCP/UDP报文格式
- Android自定义View之画笔与画布
- java序列化接口Serializable的使用
- Android 生成带图片的二维码