Support » Plugin: Popups for Divi » Can a DIVI popup be timed or page scrolled?

  • Resolved Lacko123

    (@lacko123)


    It can be somehow adjustable so that after 20 seconds to display the popup. Or it is not time-bound, but when the page scrolls to 25%, the popup will appear.

    Thanks for your response

Viewing 1 replies (of 1 total)
  • Plugin Author Philipp Stracker

    (@strackerphil-1)

    Hi @lacko123!

    That’s an awesome question. The answer is YES, but not via a UI option. The plugin is intentionally as lean and simple as possible, therefore it does not provide additional UI options in the Visual Builder.

    However, it comes with a JS API that can be used to control popups via a custom script.

    You might create a popup-section with the ID get-newsletter on your page and then add a code-block in a different section with following code:

    Example 1: Show popup after 3 seconds.

    <script>
    window.setTimeout(function(){ 
        DiviPopup.openPopup('#get-newsletter') 
    }, 3000); 
    </script>

    Example 2: Show when scrolled by 200 Pixel.

    <script>
    jQuery(window).on('scroll.popup', function() {
      if (jQuery(window).scrollTop() >= 200) {
        jQuery(window).off('.popup');
        DiviPopup.openPopup('#get-newsletter');
      }
    });
    </script>

    Let me know how it worked 🙂

    Thanks, Philipp

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