JS高手帮忙给看一下,DIV问题!!!!!! div里有个iframe,ifram嵌套了一个页面a.aspx我怎么样做才能在关闭a.aspx这个页面的时候让div关闭/隐藏?谢谢各路高手! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果关闭是指跳转到另外页面,那么在 a.aspx 的 body 中加事件 onbeforeunload="parent.document.getElementById('div的ID').style.display='none';" <html> <head> <script type="text/javascript"> function setUnload(ifm){ var win = ifm.contentWindow || ifm; win.onunload = function(){ document.getElementById('wrap').style.display = 'none'; } } </script> </head> <body style="background:#000000;"> <div id="wrap" style="background:#ffffff; display:block;"> <iframe id="test" src="inner.html" width="500" height="40" onload="setUnload(this);"> </iframe> </div> </body></html> 关于jquery的一个问题 网页视频声音无法关闭 求一个Jquery的右键2级菜单 新手学js... xmlHttp怎么在firefox下不能保存呀! window.opener给前一网页传值时不支持框架吗? 在线等!!javascript问题 非IE浏览器怎样创建FSO对象来读取C盘序列号 想问一下,编程的时候客户端到底有没有必要兼容 firefox 他山之石,可以攻错 js在那么做新闻图片切换 简单EXT问题,请大虾帮忙解决!
onbeforeunload="parent.document.getElementById('div的ID').style.display='none';"
<head>
<script type="text/javascript">
function setUnload(ifm){
var win = ifm.contentWindow || ifm;
win.onunload = function(){
document.getElementById('wrap').style.display = 'none';
}
}
</script>
</head>
<body style="background:#000000;">
<div id="wrap" style="background:#ffffff; display:block;">
<iframe id="test" src="inner.html" width="500" height="40" onload="setUnload(this);">
</iframe>
</div>
</body>
</html>