1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

how to integrate iframe and js on Divi?

Discussion in 'Free Divi Community Forum' started by sebastien, Oct 9, 2018.

  1. sebastien

    sebastien New Member

    Hello all,

    I 'm new on Divi and here. I 'm looking for a solution to integrate some iframe and JS code in a Divi page. I taste with the code module but it doesn't work.

    Here the code to integrate:

    <script type="text/javascript">
    var iframe = document.querySelector('.iframe-class');
    iframe.addEventListener("load", function() {
    var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
    var iframeHeight = innerDoc.querySelector('.container-narrow');
    iframe.height = iframeHeight.clientHeight;
    iframe.style.height = iframeHeight.clientHeight + "px";
    });
    </script>


    Please Help.

    Thanks
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade mega menu design for your Divi site without using any plugins:View Demo