├── style.css ├── README.md ├── scripts.js └── index.html /style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | 5 | .starter-template { 6 | padding: 40px 15px; 7 | text-align: center; 8 | } 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## jQuery Pagination 2 | 3 | This is a simple demonstration on how to implement pagination using jQuery. 4 | 5 | A working example can be found [here](https://codepen.io/gugui3z24/pen/VzZzgr). Additionally, a YouTube tutorial video illustrating how to create this application from scratch can be found [here](https://youtu.be/Xznn-ggD0GU). 6 | 7 | ## Description 8 | 9 | This application was created to demonstrate how to utilize jQuery to implement pagination in order to limit items displayed on each page (without the use of any plugins). 10 | 11 | ## Installation 12 | 13 | - Open the HTML file index.html in your browser. 14 | 15 | ## Contributors 16 | 17 | David Acosta. 18 | 19 | ## License 20 | 21 | No license. 22 | -------------------------------------------------------------------------------- /scripts.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var numberOfItems = $('#page .list-group').length; // Get total number of the items that should be paginated 4 | var limitPerPage = 4; // Limit of items per each page 5 | $('#page .list-group:gt(' + (limitPerPage - 1) + ')').hide(); // Hide all items over page limits (e.g., 5th item, 6th item, etc.) 6 | var totalPages = Math.round(numberOfItems / limitPerPage); // Get number of pages 7 | $(".pagination").append("
By David Acosta
39 |