• Resolved rom1our

    (@rom1our)


    Hi there,
    I made a popup for the GDPR declaration with Popup Maker. The popup is triggered to close when scrolling.
    On the front page, where Smartslider3 is loaded before content, the popup closes immediately when the slider starts loading. It seems like a scroll is generated by loading Smartslider. On the other pages it works correct.
    The code I use to close the popup is

    <script>
    jQuery(window).on('scroll', function () {
        PUM.close(123);
    });
    </script>

    Thank you

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nextendweb

    (@nextendweb)

    Hi @rom1our,
    currently Smart Slider fires a scroll event when the slider gets its responsive size. Probably this scroll event causes trouble for you.

    Would it work for you if you check in your event if the scrollTop changed and when it changed, you hide the popup?

    <script>
        var $window = jQuery(window);
        $window.ready(function () {
            var originalScrollTop = $window.scrollTop();
            $window.on('scroll', function () {
                if (originalScrollTop != $window.scrollTop()) {
                    PUM.close(123);
                }
            });
        });
    </script>
    Thread Starter rom1our

    (@rom1our)

    Great, it works! Thank you.

    Plugin Author Nextendweb

    (@nextendweb)

    @rom1our, I’m glad I could help! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Scroll at smartslider load’ is closed to new replies.