Hi @klaggy
Please try slightly different version of the code. Here is an entire code to test:
<?php
add_action('wp_footer', 'forminator_scroll_top_script', 9999);
function forminator_scroll_top_script()
{
global $post;
if (is_a($post, 'WP_Post') && !has_shortcode($post->post_content, 'forminator_form')) {
return;
}
?>
<script type="text/javascript">
jQuery('#forminator-module-3010').find('.forminator-button-next').on('click', function(){
jQuery("html, body").stop();
var scrolltop = jQuery('.forminator-pagination').offset().top;
jQuery("html, body").animate({ scrollTop: scrolltop + 200 }, 500);
});
jQuery('#forminator-module-3010').find('.forminator-button-back').on('click', function(){
jQuery("html, body").stop();
var scrolltop = jQuery('.forminator-pagination').offset().top;
jQuery("html, body").animate({ scrollTop: scrolltop + 200 }, 500);
});
jQuery( document ).on( 'forminator.front.pagination.move', function( e ) {
jQuery("html, body").stop();
var scrolltop = jQuery('.forminator-pagination').offset().top;
jQuery("html, body").animate({ scrollTop: scrolltop + 200 }, 500);
});
jQuery('.forminator-step').on('click', function( e ) {
jQuery("html, body").stop();
var scrolltop = jQuery('.forminator-pagination').offset().top;
jQuery("html, body").animate({ scrollTop: scrolltop + 200 }, 500);
});
</script>
<?php
}
– don’t add it to existing code but instead replace entire code in your MU plugin with above one
– and replace both occurrences of number 3010 in it with your form ID
There is only a slight difference comparing to original one but this version seems to be working fine on my end – reacting to clicks on both next/prev buttions and paging.
Also: in case it still didn’t work, try switching form between “Load form using AJAX” option enabled vs disabled in form’s “Behavior” settings.
Kind regards,
Adam