gppt_swiper_options (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Examples
    1. Scroll to the top of the page instead of form when slides change
  5. Since

Description

Filter the options passed to Swiper during initialization.

Usage

window.gform.addFilter( 'gppt_swiper_options', 'my_custom_function' );

Parameters

Examples

Scroll to the top of the page instead of form when slides change

/**
 * 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;
});

Since

This filter is available since Gravity Forms Page Transitions 1.0.