I'm using dataTables (https://datatables.net) and trying to do a responsive page number, I need this:
Desktop: first prev 1 2 3 4 5 next last
Mobile: first prev 1 2 3 next last
Actually with my code I get this on mobile, nothing change: first prev 1 2 3 4 5 next last
This is my code:
$(window).resize(function () {
if ($(this).outerWidth() < 768){
// change the dataTable pageLength in here
$.fn.DataTable.ext.pager.numbers_length = 3;
} else {
// default pageLength
$.fn.DataTable.ext.pager.numbers_length = 5;
}
});