div中的iframe会切断内容 [英] iframe inside div cut off content
问题描述
我在div内有一个iframe.问题是,iframe内部有一个扩展菜单(垂直扩展).因此,iframe的高度将是动态的,具体取决于展开的项目.当我展开它时,它会切断并且不会显示.以下是div和iframe的代码.
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>
这是两个项目的CSS.
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%;
}
我要实现的是iframe会根据扩展菜单进行扩展,并且不会被截断.
what i want to achieve is that the iframe will expand according to the expanded menu and also not being cut off.
推荐答案
答案在您的CSS中,
你可以写这个
overflow-y:scroll; //that will create a scroll in the iframe the content will not be hidden,
当您编写 OVERFLOW:HIDDEN;
时,将导致contrat在溢出中增加并且将减少,因此不会显示.
while you write OVERFLOW: HIDDEN;
it will take the contenr increase in overflow and will cut down, will not shown.
用于新链接
请参考以前的对话
http://stackoverflow.com/questions/934323/control-iframe-height-with-jquery
那将做:)
这篇关于div中的iframe会切断内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!