This article mainly introduces the implementation code of layui front-end frame paging effect in detail. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.
<!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>
Rendering:
Related recommendations:
Simple implementation of Ajax without Refresh the paging effect
PHP function example that imitates Google’s paging effect
php example of implementing the paging effect
The above is the detailed content of Layui paging effect realizes code sharing. For more information, please follow other related articles on the PHP Chinese website!