Skip to content

Instantly share code, notes, and snippets.

@jpblancoder
Created March 6, 2025 21:49
Show Gist options
  • Save jpblancoder/cb4873ec552e52ff35f9038c05b79005 to your computer and use it in GitHub Desktop.
Save jpblancoder/cb4873ec552e52ff35f9038c05b79005 to your computer and use it in GitHub Desktop.

Revisions

  1. jpblancoder renamed this gist Mar 6, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jpblancoder created this gist Mar 6, 2025.
    24 changes: 24 additions & 0 deletions iframe-resize-event.
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <html lang="en-CA">
    <head></head>
    <body>
    <div>Your regional map widget here</div>
    <script>
    (function() {
    function handleResize() {
    if (window.parent !== window) {
    window.parent.postMessage({
    type: "@fusion/pageSize",
    payload: {
    height: document.body?.scrollHeight,
    width: document.body?.scrollWidth,
    },
    }, "*");
    }
    }
    window.addEventListener("DOMContentLoaded", handleResize);
    window.addEventListener("load", handleResize);
    window.addEventListener("resize", handleResize);
    })();
    </script>
    </body>
    </html>