Created
March 21, 2018 08:12
-
-
Save techjewel/25b2d10f78905464fb461eef27d91215 to your computer and use it in GitHub Desktop.
Paging number click event and scroll to ninja tables beginning - WordPress Ninja Tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Change the offset value based on your theme. If you have fixed with header then you may need to increase the value | |
This code snippet only work on https://wordpress.org/plugins/ninja-tables/ | |
*/ | |
jQuery(document).ready(function() { | |
jQuery('table.ninja_footable').on('click', '.footable-page-link', function (e) { | |
var offset = 50; | |
jQuery('html, body').animate({ | |
scrollTop: jQuery(this).closest('table.ninja_footable').offset().top - offset | |
}, 500); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment