Click here to Skip to main content
14,384,492 members
Rate this:
Please Sign up or sign in to vote.
See more:
how to set iframe height on runtime according to container page size.
means if the container page size is 1000px,then iframe size should be adjust 1000px.
Posted
Comments
Zoltán Zörgő 13-Apr-13 2:31am
   
You can do this only if inner and outer frame source is the same domain or they have cross domain trust enabled.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try this!!

<iframe id="Iframe1" src="~/Aspx/Popup/PanelMembers.aspx" onload="setSize()"runat="server"></iframe>

function setSize() {
           var iframeElement = parent.document.getElementById('Iframe1');
           var height = document.documentElement.clientHeight - 100;
           iframeElement.style.height = height + "px";
       }
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100