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

Salesforce Marketing Cloud Integration with Google Analytics 360

Redefining the future of Marketing – Salesforce Marketing Cloud Integration with Google Analytics 360

Blog in

Know your customers better and make smarter, insight-based marketing decisions through Salesforce’s massive customer relationship management platform twinned with Google Analytics 360’s market-leading digital analytics solution…

Popular Salesforce Videos