Skip to content

Instantly share code, notes, and snippets.

@karmeljuk
Created July 21, 2015 14:16
Show Gist options
  • Save karmeljuk/6090b57f0ad394b37bbb to your computer and use it in GitHub Desktop.
Save karmeljuk/6090b57f0ad394b37bbb to your computer and use it in GitHub Desktop.
paginateScroll
//переносить сторінку вниз при кліку на пейджері
var firstHeight = $(table).height();
function paginateScroll() {
var scrollElement = $('html, body');
var secondHeight = $(".dataTables_wrapper").height();
if (firstHeight > secondHeight) {
scrollElement.animate({
scrollTop: firstHeight
}, 500);
}
else {
scrollElement.animate({
scrollTop: secondHeight
}, 0);
}
}
$(".dataTables_paginate .paginate_button").click(paginateScroll());
$("#download-search-form-submit").click(function(e) {
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment