Is it possible to have a timed pop-up window on the website with Blocs?

I am trying to achieve a pop-up window that appears when scrolling. Can you help with this? It doesn’t matter if it’s a modal; what I need is for it to show up when scrolling.

Should still work.

1 Like

This one works better. For some reason the one you shared is outdated.

<!-- SCRIPT GLOBAL MODAL SCROLL -->
<script>
document.addEventListener('DOMContentLoaded', function() {
  var modalTriggered = false;
  var scrollThreshold = 180;

  function handleScroll() {
    if (!modalTriggered && (window.pageYOffset || document.documentElement.scrollTop) > scrollThreshold) {
      modalTriggered = true;
      var modalEl = document.getElementById('YOUR MODAL NAME HERE');
      if (modalEl && window.bootstrap) {
        var modalInstance = bootstrap.Modal.getOrCreateInstance(modalEl);
        modalInstance.show();
      }
      window.removeEventListener('scroll', handleScroll);
    }
  }

  window.addEventListener('scroll', handleScroll, { passive: true });
});
</script>

Thanks for asking it man.