html页面上嵌入的iframe,如何关闭?

父页面:

<div id="dep_select" οnclick="$(this).css('display', 'none')" style="width: 100%; height: 100%; z-index: 1000; position:fixed; top: 0; left: 0; background:rgba(0,0,0,0.5); display: none;">
<iframe src="${ctx.contextPath}/strpubv2/dep_select.html" width="1250px" height="600px;" style="position:fixed;top:50%;left:50%;margin:-300px 0 0 -625px;z-index:1001;border: none;"></iframe>
</div>

在嵌入的iframe 页面中加上这样的JS代码即可

parent.document.getElementById("dep_select").style.display = "none";

转载于:https://www.cnblogs.com/daijun/p/6102222.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值