使用Jquery关闭Iframe
Close Iframe With Jquery?
我知道有很多这样的问题,但我们已经知道每个案例都不一样。
所以,这是我的例子:
HTML输出:PAGE 1
<div id="login-embedded" style="height: 401px; display: none;">
<iframe frameborder="0" src="{$mybb->settings['bburl']}/login.php" style="height: 401px;"></iframe>
</div> <!-- /end login-embedded -->
<div id="blackout"></div>
HTML输出:IFRAME
<div id="embedded-login">
<h1>{$lang->login}</h1>
<form method="post" action="{$mybb->settings['bburl']}/member.php">
<a id="embedded-close" href="javascript:;" onclick="jQuery('#blackout, #login-embedded').hide('slow');" rel="closeLogin"></a>
<div>
......
</div>
JQUERY: jQuery(document).ready(function(){
jQuery('a[name="login"]').click(function(){
jQuery("#blackout").fadeIn(1000);
jQuery("#blackout").fadeTo("slow",0.8);
jQuery("#login-embedded").show();
return false
});
jQuery("#embedded-login a#embedded-close").click(function(){
jQuery("#blackout").hide("slow");jQuery("#login-embedded").hide("slow");
return false
});
jQuery("#blackout").click(function(){
jQuery(this).hide("slow");
jQuery("#login-embedded").hide("slow");
return false
})
});
我错过什么了吗?我找到了一个解决方案,通过使用jquery对话框关闭iframe,但似乎它不能在我的情况下工作。
任何帮助将不胜感激!谢谢!
您的onclick="jQuery('#blackout, #login-embedded').hide('slow');"
在iframe中不会做任何事情,因为这些元素在父页面上。试试这个:
onclick="window.parent.jQuery('#blackout, #login-embedded').hide('slow');"
window.parent.jQuery
位将使用父文档的jQuery实例来运行动画
相关文章:
- 如何关闭html中的iframe弹出窗口
- 检查iframe内部的窗口是否已关闭
- iframe模态无法关闭
- 单击iframe时如何关闭它
- 使用按钮关闭 iframe 模式
- HTML/JavaScript:如何通过 id 从父页面关闭 iframe
- js iframe 关闭按钮
- 从父窗口上的iFrame内容中关闭iFrame
- 关闭iframe中的模式弹出窗口
- 从子项(iframe)检测窗口关闭命令
- 在 iframe 花式框关闭后刷新父窗口
- 从 iframe 内部关闭引导模式,然后转到父页面的特定部分
- 在 iframe 中关闭颜色框
- 当弹出窗口关闭时,父 iframe 不会重新加载
- 我想在 iframe 关闭 bt 后重新加载页面,它在加载时重新加载
- 如何从不同域上的 iFrame 关闭花式盒子(灯箱)
- 通过单击模式 iframe 关闭对话框
- 可以't从iframe关闭colorbox窗口
- 如何获得一个iframe关闭后打开另一个iframe使用Jquery
- 灯箱iframe关闭