javascript – IE10 / Safari无法隐藏iFrame中的对象/ Flash
作者:互联网
我在iFrame中有一个Flash动画.当我试图隐藏它时,IE10会保持显示并重叠其他内容.
Here an example.
<body style="background-color: #EEE">
Testing IE10
<div id="swfDiv">
<iframe src="swf.html" width="500" height="50"></iframe>
<br />
<button onclick="document.getElementById('swfDiv').style.display='none'">Hide</button>
</div>
<div style="background-color: #DDD">
This try to hide the animation, but it is not working on IE10. <br/> It works fine in others browsers and earlier versions of IE.
</div>
</body>
更新02/08/2013
我在Safari(5.1.7)中发现了同样的问题
解决方法:
显然,最好的解决方案是将其移出屏幕:
.xhide
{
display: block;
position: absolute;
left:-9999px;
}
我们可以在点击时添加这个类来隐藏它,例如:
document.getElementById('swfDiv').className = "xhide";
标签:javascript,css,flash,iframe,internet-explorer-10 来源: https://codeday.me/bug/20190529/1179799.html