Divi Code Module · Embed Snippet

Embed This Handout

Paste the code below into a Divi Code Module on any page. The iframe will automatically resize to match the full height of the app — no scrollbars, no clipping.

  1. In Divi, set the page template to Full Width (no sidebar) — Page Attributes → Template → Full Width.
  2. In Divi Builder, set the row to full width and remove all column padding/gutters.
  3. Add a Code module and paste the snippet below.
  4. Save & publish — the iframe auto-resizes to its full content height.
HTML
<iframe id="sjbc-aging" src="https://masked-chronos-insight-flow.base44.app" style="width:100%;border:none;display:block;overflow:hidden;" scrolling="no" title="Spirituality &amp; Aging — Rev. Carolyn Grey"></iframe>
<script>
(function() {
  var iframe = document.getElementById('sjbc-aging');
  window.addEventListener('message', function(e) {
    if (e.data && e.data.iframeHeight) {
      iframe.style.height = Math.round(e.data.iframeHeight) + 'px';
    }
    if (e.data && e.data.scrollToIframeTop) {
      iframe.scrollIntoView({ behavior: 'smooth', block: 'start' });
    }
    if (e.data && e.data.scrollToOffset !== undefined) {
      var iframeTop = iframe.getBoundingClientRect().top + window.pageYOffset;
      window.scrollTo({ top: iframeTop + e.data.scrollToOffset, behavior: 'smooth' });
    }
  });
})();
</script>

How it works

The app broadcasts its scrollHeight to the parent page via postMessage whenever its content changes. The snippet's listener sets the iframe height to match — eliminating double scrollbars. The app itself is capped at 1400px max-width so it never stretches across ultra-wide screens.