Hi,
thanks for your post, and sorry for the trouble.
Yes, this should be possible. I made small TablePress Extension out of this. To use that, please download https://pastebin.com/raw/tJLxD2XZ and save it as a new plugin on your site, in the folder
/wp-content/plugins/tablepress-datatables-pagination-scrolltotop/tablepress-datatables-pagination-scrolltotop.php
After that, activate the new plugin “TablePress Extension: DataTables Pagination ScrollToTop” on your site. Then, to use this with your tables, add an extra parameter to the Shortcode on the page where you are showing the table, like
[table id=123 datatables_pagination_scrolltotop=true /]
Regards,
Tobias
Thank you very much for your efforts with this. I have followed your directions but I am not getting the scroll to top interaction. See here: https://endless-jungle.jurassic.ninja/table-to-top-test/
Thanks, 🙂
Hi,
ah, my bad. Please delete line 16
add_filter( 'tablepress_datatables_parameters', 'tablepress_add_pagination_scrolltotop_js_parameter', 10, 4 );
from the file.
Then, please also change the line (near the end)
$( document ).scrollTop( $( table.table().container() ).offset().top );
to
$( document ).scrollTop( $( {$name}.table().container() ).offset().top );
Regards,
Tobias
Amazing! Thank you very much. This works great! 🙂
Thank you!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!