Scroll to top of page instead of top of form

  1. Install this snippet with our free Code Chest plugin. https://gravitywiz.com/gravity-forms-code-chest/

Code

Filename: gppt-scroll-to-top.js

/**
 * Gravity Perks // Page Transitions // Scroll to top of page instead of top of form
 * https://gravitywiz.com/documentation/gravity-forms-page-transitions/
 *
 * 1. Install this snippet with our free Code Chest plugin.
 *    https://gravitywiz.com/gravity-forms-code-chest/
 */
gform.addFilter('gppt_swiper_options', function (options) {
    options.on.slideChange = function () {
        window.scroll({
            top: 0,
            left: 0,
            behavior: 'smooth'
        });
    }
	
    return options;
});

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.