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/
 *
 * If using Gravity Forms Custom Javascript, you will also need to install
 * the follow snippet: https://gravitywiz.com/snippet-library/gfjs-early-init-scripts/
 */
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.