-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
61 lines (55 loc) · 1.59 KB
/
test.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>pagination example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/paginationjs/2.1.4/pagination.min.js"></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/paginationjs/2.1.4/pagination.css"
/>
</head>
<body>
<div>
<section>
<div id="data-container"></div>
<div id="pagination"></div>
</section>
</div>
<script>
$(function () {
let container = $("#pagination");
container.pagination({
dataSource: [
{ name: "hello1" },
{ name: "hello2" },
{ name: "hello3" },
{ name: "hello4" },
{ name: "hello5" },
{ name: "hello6" },
{ name: "hello7" },
{ name: "hello8" },
{ name: "hello9" },
{ name: "hello10" },
{ name: "hello11" },
{ name: "hello12" },
{ name: "hello13" },
{ name: "hello14" },
{ name: "hello15" },
{ name: "hello16" },
{ name: "hello17" },
],
callback: function (data, pagination) {
var dataHtml = "<ul>";
$.each(data, function (index, item) {
dataHtml += "<li>" + item.name + "</li>";
});
dataHtml += "</ul>";
$("#data-container").html(dataHtml);
},
});
});
</script>
</body>
</html>