This repository was archived by the owner on Mar 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (47 loc) · 1.32 KB
/
index.html
File metadata and controls
47 lines (47 loc) · 1.32 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery Paging Demo</title>
<style type="text/css">
#paging{text-align:center;}
a.paging-item,a.paging-side{margin:0 .25em;}
a.paging-item.selected{font-weight:bold;}
</style>
</head>
<body>
<div id="paging"></div>
<p>
<button type="button" class="paging-function" value="1">Change page to 8</button>
<button type="button" class="paging-function" value="2">Change max page to 101</button>
<button type="button" class="paging-function" value="3">Destroy and create paging with another options</button>
</p>
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="jquery.paging.js"></script>
<script type="text/javascript">
$('#paging').paging({
current:5,max:45,
onclick:function(e,page){
alert('going to page '+page);
}
});
$('.paging-function').on('click', function(){
switch(this.value){
case '1':
$('#paging').paging({current:8});
break;
case '2':
$('#paging').paging({max:101});
break;
case '3':
$('#paging').paging('destroy');
setTimeout(function(){
$('#paging').paging({current:2,max:50});
},1000);
break;
}
return false;
});
</script>
</body>
</html>