Adds Pagination with hash change
<div id="paging-nav"></div>
<ul id="gallery" class="clearfix">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>30</li>
</ul>
Use the plugin as follows:
<script src="js/libs/jquery-1.9.0.min.js"></script>
<script src="js/jquery.pagination-with-hash-change.js"></script>
<script>
$(document).ready(function() {
$('#gallery').paginationwithhashchange({
pagingId: '#paging-nav',
itemsPerPage: 5
});
});
</script>
The generated HTML source in <div id="paging-nav"> </div>
:
<ul>
<li class="active"><a href="#1">1</a></li>
<li><a href="#2">2</a></li>
<li><a href="#3">3</a></li>
<li><a href="#3">3</a></li>
<li><a href="#4">4</a></li>
<li><a href="#5">5</a></li>
<li><a href="#30">30</a></li>
</ul>
- Requires jQuery 1.9+.
- tested in IEE 8, IE 9, 10, 11 Safarie, Firefox, Chrome
This plugin is dual licensed under the MIT and GPL licenses.