【发布时间】:2013-12-27 12:34:39
【问题描述】:
在我的基于流星的应用程序中,我使用 I 框架向用户显示一些内容。它工作正常。但我想放置一个关闭按钮,当单击该按钮时,它会从模板中卸载 iframe。
我通过放置一个按钮在下面给出的代码中进行了尝试,但我无法在其上获得点击事件。表示按钮单击不起作用。我第一次使用 iframe。
这是卸载 iframe 的正确方法吗?
如果没有,那么我该如何卸载它,或者卸载 iframe 的最佳方法是什么?
<template name="preview">
<div style='display:none'>
<div id='preview' style='padding:10px; background:#fff;'>
<button id="close_content_file">Close</button>
<iframe frameborder="1" src="{{preview_url}}" align="left" width="100%" height="500px" >
</iframe>
</div>
</div>
Template.preview.events({
'click #close_content_file':function(){
console.log(" previev butoon has been clicked");
$("#preview").fadeOut();
},
});
我在 div 中放置了 <button></button> 以关闭或卸载 Iframe。但是单击该按钮不起作用。如果我将按钮放在隐藏的 div 中。该按钮在那里工作。 iframe 正在整个屏幕上打开。意味着它将整个屏幕覆盖为引导模式对话框。我可以在 Iframe 本身中放置一个按钮吗? .帮助将是可观的
【问题讨论】:
标签: javascript jquery iframe meteor meteorite