-
-
Save joshfeck/ac7ef63edc47ba37a813 to your computer and use it in GitHub Desktop.
Scroll to top of the page during Event Espresso's Single page checkout steps
This file contains 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
<?php | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function my_always_scroll_to_top() { | |
?> | |
<script> | |
jQuery( document ).on('ajaxComplete ready', function() { | |
var scroll_pos=(0); | |
jQuery('html, body').animate({scrollTop:(scroll_pos)}, '2000'); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', 'my_always_scroll_to_top' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment