<>强工具(框架,插件)强>
1, layui-v1.0.9
2,jquery-1.8.3
代码
<强> 1,jsp代码(可忽略jsp部分,转成html) 强>
% @ & lt;页面语言=癹ava”contentType=" text/html;charset=utf - 8”%比; % @ & lt;包含文件="/共同/include/taglib.jsp”%比; & lt; % & lt; html> & lt; head> & lt; title>测试page & lt;元charset=皍tf - 8”比; & lt;元name=笆哟啊蹦谌?翱矶?设备宽度,初始=1,最大范围=1”比; & lt;元http-equiv=皒-ua-compatible”内容=癷e=8”/比; & lt;链接rel="样式表" href=" https://www.yisu.com/zixun/ad/layui/css/layui.css " rel=巴獠縩ofollow”比; & lt; style> .left_buttons{浮动:左;margin-top: 3 px;} .search{浮动:对;margin-top: 3 px;} .dataTable{明确:;} th {min-width: 90 px; text-align:中心;} tfoot {text-align:中心;} #修改{宽度:18 px;填充:0 5 0 5;} # dlt{宽度:18 px;填充:0 5 0 5;} & lt;/style> & lt;/head> & lt; body> & lt; div> & lt; div类=岸ゼ丁北? & lt; div类=發eft_buttons”比; button1 button2 & lt;/div> & lt; div类="搜索"比; & lt;形式类=" layui-form搜索输入" action="比; & lt; div class=" layui-form-item layui-form-pane”比; & lt; div类=發ayui-input-block”比; & lt;输入类型=拔谋尽钡拿?氨晏狻毙枰猯ay-verify=皉equired”占位符=扒胧淙胫魈狻白远瓿?=發ayui-input”/肮乇铡崩嗟脑? & lt;/div> & lt;/div> & lt;/form> & lt;/div> & lt;/div> & lt; div类=笆荼怼北? & lt; div class="表格内容”比; & lt;表类=" layui-table " lay-skin=跋摺北? & lt; colgroup> & lt;坳宽度=" 150 "比; & lt;坳宽度=" 200 "比; & lt; col> & lt;/colgroup> & lt; thead> & lt; tr类=皌able_title”比; & lt; th> col1 & lt; th> col2 & lt; th> col3 & lt; th> col4 & lt; th> col5 & lt; th> col6 & lt; th> col7 & lt; th> col8 & lt; th> col9 & lt; th> col10 & lt; th> col11 & lt;/tr> & lt;/thead> & lt; tbody类=癲ataBody”比; & lt;/tbody> & lt; tfoot> & lt; tr> & lt; td colspan=笆弧北? & lt;跨类=" water-table-listbtn "祝辞& lt;/span> & lt;跨类=" water-table-page "祝辞& lt;跨度id=皃agemsg”class=皐ater-table-pagemsg”在当前0/0页& lt;/span> & lt;输入类型="按钮" id=" fpbtn " value=" https://www.yisu.com/zixun/首页”/比; & lt;输入类型="按钮" id=" rpbtn " value=" https://www.yisu.com/zixun/上页”/比; & lt;输入类型="按钮" id=" npbtn " value=" https://www.yisu.com/zixun/下页”/比; & lt;输入类型="按钮" id=" lpbtn " value=" https://www.yisu.com/zixun/尾”页/比; & lt;跨越id=皃agemsg”类=皐ater-table-pagemsg”在跳转到& lt;输入type="文本" id=" gpinput "大?" 3 " value=" https://www.yisu.com/zixun/0 "/祝辞页& lt;/span> & lt;输入类型="按钮" id=" gpbtn " value=" https://www.yisu.com/zixun/跳转”/比; & lt;/span> & lt;/td> & lt;/tr> & lt;/tfoot> & lt;/table> & lt;/div> & lt;/div> & lt;/div> & lt; !——此处是最外围DIV——比; & lt;脚本src=" https://www.yisu.com/bhps/ad/layui/layui.js "祝辞& lt;/script> & lt;脚本src=" https://www.yisu.com/js/jquery/jquery-1.8.3.min.js "祝辞& lt;/script> & lt;脚本src=" https://www.yisu.com/bhps/ad/js/component.js "祝辞& lt;/script> & lt; script> var用户id=" & lt; %=request.getAttribute (userId) %祝辞”; var页面=0; var页面=0; var=8行; & lt;/script> & lt;/body> & lt;/html> >之前<强> 2,js代码强>
$(文档)时函数(){ $ (" # fpbtn”)。attr(“禁用”,真正的); $ (" # rpbtn”)。attr(“禁用”,真正的); rewriteTable(页面、行1); }); 函数rewriteTable(页面、行isReplace) { $ . post (“ADTasks.ered& # 63; reqCode=queryAssignTask”, {loginuserid: userId, 开始:页面*行, 限制:行 }, 函数(结果){ 如果结果。resultCode==200) { 如果(isReplace) { $ (" .dataBody ") . html (" "); } 页面=changeShowedPage(+ 1页,result.total); buttonControl(页面,页);//警报(result.data.length); (var=0;ilayui + jquery支持IE8的表格分页方法