1

i have an iframe inside a div. the thing is, the iframe have an expanding menu (expands vertically) inside it. so, the height of the iframe will be dynamic, depending on what item is expanded. when i expand it, it will cut off and not show. below is the code for the div and the iframe.

 <div class="camera">
<iframe name="ifra" id="ifra"  title ="iframe" src="pages/whitef.html" frameBorder=0 scrolling="no"></iframe>
</div>

this is the css for both item.

iframe#ifra{
position: relative;
width: 810px;
min-height: 750px;
height:100%;
margin-top: -40px;
z-index: 1;
border:none;
overflow:hidden;
}
.camera {
height: 100%;
}

what i want to achieve is that the iframe will expand according to the expanded menu and also not being cut off.

Shazery Nasir
  • 281
  • 1
  • 6
  • 16

2 Answers2

0

Answer is in your CSS,

you may write this

overflow-y:scroll; //that will create a scroll in the iframe the content will not be hidden,

while you write OVERFLOW: HIDDEN; it will take the contenr increase in overflow and will cut down, will not shown.

Edit : for new link

Refer Old conversation for the same

http://stackoverflow.com/questions/934323/control-iframe-height-with-jquery

that will do :)

MarmiK
  • 5,639
  • 6
  • 40
  • 49
  • 1
    i do not want scrollbars in it. thats why i hidden the overflow. – Shazery Nasir Mar 25 '13 at 05:27
  • then please verify the height approximation and use the `height:???px` as `height:100%` will not help here. thank you, – MarmiK Mar 25 '13 at 06:40
  • i want the i frame to follow the size since i have expanding menu inside of the iframe. so, setting the max height is okay, but it will leave a lot of space if the menu is collapsed. – Shazery Nasir Mar 25 '13 at 06:49
  • @ShazeryNasir I think this will help, refer the link of old conversation, `http://stackoverflow.com/questions/934323/control-iframe-height-with-jquery` here see the second answer with function by "Jose Basilio". I hope that will do. :) – MarmiK Mar 25 '13 at 08:01
0

ok this plug-in is out there to do what you requested, but it works only if the iframe src is in your domain.

there is also an article on css tricks you might want to look at.

btevfik
  • 3,391
  • 3
  • 27
  • 39