最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

layui分页效果实现代码分享

来源:动视网 责编:小OO 时间:2020-11-27 20:06:40
文档

layui分页效果实现代码分享

<。fenye=';.';';) //获取hash值为fenye的当前页 ,hash: ';fenye';//自定义hash值 });laypage({ cont: ';demo7';,pages: 100 ,skip: true });});<;/script>;<;/body>;<;/html>;效果图。
推荐度:
导读<。fenye=';.';';) //获取hash值为fenye的当前页 ,hash: ';fenye';//自定义hash值 });laypage({ cont: ';demo7';,pages: 100 ,skip: true });});<;/script>;<;/body>;<;/html>;效果图。
 本文主要为大家详细介绍了layui前段框架分页效果的实现代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,希望能帮助到大家。

<!DOCTYPE html>
<html>
 <head>
 <meta charset="UTF-8">
 <title>分页</title>
 <link rel="stylesheet" href="layui/css/layui.css" >
 </head>
 <body>
 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
 <legend>开门见山 : 默认分页</legend>
 </fieldset>
 <p id="demo1"></p>
 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
 <legend>开启 URL hash</legend>
 </fieldset>
 <p id="demo5"></p>

 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
 <legend>是时候看一下完整功能了!</legend>
 </fieldset>
 <p id="demo7"></p>

 <script src="layui/layui.js"></script>
 <script>
 layui.use(['laypage', 'layer'], function(){
 var laypage = layui.laypage
 ,layer = layui.layer;

 laypage({
 cont: 'demo1'
 ,pages: 100 //总页数
 ,groups: 5 //连续显示分页数
 });

 laypage({
 cont: 'demo5'
 ,pages: 100
 ,curr: location.hash.replace('#!fenye=', '') //获取hash值为fenye的当前页
 ,hash: 'fenye' //自定义hash值
 });
 laypage({
 cont: 'demo7'
 ,pages: 100
 ,skip: true
 });
 });
 </script>
 </body>
</html>

效果图:

文档

layui分页效果实现代码分享

<。fenye=';.';';) //获取hash值为fenye的当前页 ,hash: ';fenye';//自定义hash值 });laypage({ cont: ';demo7';,pages: 100 ,skip: true });});<;/script>;<;/body>;<;/html>;效果图。
推荐度:
标签: 代码 效果 分页
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top