-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
34 lines (33 loc) · 1.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>laypage</title>
<link rel="stylesheet" href="./laypage.css">
</head>
<body>
<div id="test1"></div>
<script src="./laypage.js"></script>
<script>
//执行一个laypage实例
laypage.render({
elem: 'test1' //注意,这里的 test1 是 ID,不用加 # 号
,count: 500 //数据总数,从服务端得到
,limit:50
,limits:[10,20,30]
,layout:['prev','page','next','count','limit','refresh','skip']
,jump: function(obj, first){
//obj包含了当前分页的所有参数,比如:
console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
console.log(obj.limit); //得到每页显示的条数
//首次不执行
if(!first){
//do something
}
}
});
</script>
</body>
</html>