Support » Plugin: Powerful Gutenberg Blocks and Templates - Ghost Kit » Animate on scroll trigger too low

  • Resolved Robinsansom

    (@robinsansom)


    Thanks for this excellent plugin.

    However, I’m finding that if the page has a fixed header ‘animate on scroll’ is triggered when the element is a little below the bottom of the screen. Is there a way I can offset this? It would be useful to have a setting to control this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nK

    (@nko)

    Hey.

    Thank you for using it 🙂

    In the coming plugin update will be added new jQuery event and you will be able to change ScrollReveal config.

    PHP code example, that will change default value viewFactor (https://scrollrevealjs.org/api/view-factor.html):

    add_filter( 'script_loader_tag', 'gktChangeSRConfig', 10, 2 );
    
    if ( ! function_exists( 'gktChangeSRConfig' ) ) {
        function gktChangeSRConfig( $tag, $handle ) {
            if ( 'ghostkit' === $handle ) {
                $tag = "
                    <script>
                        jQuery( document ).on( 'beforeInitSR.ghostkit', function( evt, classObject, element, config ) {
                            config.viewFactor = 1;
                        } );
                    </script>
                    " . $tag;
            }
    
            return $tag;
        }
    }
    

    p.s. better to filter elements and change the config only on a specific element, not for all.

    Regards, nK.

    Thanks look forward to the update.

    Regards
    RS

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.