Activity Forums Salesforce® Discussions How to create Salesforce visualforce page with iframe with auto resizing height?

  • PRANAV

    Member
    October 4, 2016 at 5:13 am

    Hi Tanu,

    You can resize the iframe with JavaScript after you know the size of the browser viewport:

    <apex:page sidebar="false">
    <apex:iframe src="https://www.salesforce.com/" id="theFrame" />
    <script>document.getElementById('theFrame').height = window.innerHeight - 220;</script>
    </apex:page>

    Leave about 220 pixels for the Salesforce header and footer.

    Hope this helps you.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos