I am trying to implement paging in PHP. First of all I am getting the number of pages as per page record and generating <li>
links dynamically by number of pages. Like this:
for($i = 1; $i <= $no_of_pages; $i++)
{
echo '<li><a href="view_records.php?pageno='.$i.'">'.$i.'</a></li>';
}
It's fine, but the problem is that when the number of pages is more than 10, the page number wraps to the next line. I want to scroll them by clicking left and right 10 pages each time.
Suppose I have 35 pages, so this will display all 35 pages links
left 1 2 3 4 5 6 7 8 9 10 11 12 ......35 right
But I want only
left 1 2 3 4 5 6 7 8 9 10 right
When I click on right
this will scroll right and should display
left 11 12 13 14 15 17 18 19 20 right
Again right
will display next 10 pages link. Is there anything in JS or jQuery to control that li
for scrolling? It will be become easy because I get total no of pages by PHP and put link of them in HTML and user can directly move to desired page.