JQuery Pagination
by GOKILAVANI[ Edit ] 2014-06-09 09:40:52
<div id="pagination"></div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$("#pagination").paging(1337, {
format: '[< ncnnn >]',
onSelect: function (page) {
// add code which gets executed when user selects a page
},
onFormat: function (type) {
switch (type) {
case 'block': // n and c
return '<a>' + this.value + '</a>';
case 'next': // >
return '<a>></a>';
case 'prev': // <
return '<a><</a>';
case 'first': // [
return '<a>first</a>';
case 'last': // ]
return '<a>last</a>';
}
}
});
</script>
sample output: