I have list of pagination from ajax response. how to hide the later pages and show pagination according the limiter.
If the limiter is 5 have to show only 10 page links and hide later pages.
1 2 3 4 5 6 7 8 9 10 .. next
11 12 13 14 15.. next
I have tried to count the li length from the ajax response it doesn't show the count. how to get the count and hide and show later pages.
output:
next_page_num: <li>1</li><li>2</li><li>3</li><li>5</li><li>6</li><li>7</li>..
success: function(response){
$("#listing_products").html("");
$("#listing_products").html(response.html_content);
$("ul.pagination").html("");
$("ul.pagination").html(response.next_page_num);
if(page_limit==5){
var product_listing_count = response.next_page_num;
if($(product_listing_count).length>8){
//How to hide after 8th pages and hide later pages add next to 8th page
));
}
$("ul.pagination").html("");
$("ul.pagination").html(response.next_page_num);
}