我使用羽毛光通过iFrame打开图像上传/调整大小/裁剪页面。
我想在用户点击closeTrigger (在iFrame中)时立即调用它,这样他们就不需要手动关闭它了
我对此有点困惑。我检查了min.js,但是找不到任何东西,我也没有找到绑定在关闭按钮上的Javascript动作.
有什么想法吗?
发布于 2016-06-30 20:45:57
我在这里找到了答案,How do I remove iframe within itself by using javascript
iFrame (做完每件事后):
<script>parent.window.postMessage("closetheiframe", "*");</script>ParentWindow:
<script>
function receiveMessage(event){
if (event.data=="closetheiframe"){
var current = $.featherlight.current();
current.close();
}
}
window.addEventListener("message", receiveMessage, false);
理论上说,如果featherlight.current工作正常,这也会帮助我在页面上使用不同的iFrames来打开和关闭(但不是同时)
https://stackoverflow.com/questions/38132478
复制相似问题