Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created February 25, 2016 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshfeck/ac7ef63edc47ba37a813 to your computer and use it in GitHub Desktop.
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
<?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