admin管理员组文章数量:1289565
I know there are a lots of questions like this, but we're already knew that each cases are not like each other.
So, this is my case :
HTML OUTPUT: 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 OUTPUT: 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
})
});
Did I miss anything here ? I found a solution for closing an iframe by using jquery dialog but seem it can't work in my case.
Any help will be appreciated ! Thanks!
I know there are a lots of questions like this, but we're already knew that each cases are not like each other.
So, this is my case :
HTML OUTPUT: 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 OUTPUT: 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
})
});
Did I miss anything here ? I found a solution for closing an iframe by using jquery dialog but seem it can't work in my case.
Any help will be appreciated ! Thanks!
Share Improve this question asked May 16, 2013 at 6:36 LCTGLCTG 2501 gold badge3 silver badges14 bronze badges1 Answer
Reset to default 9Your onclick="jQuery('#blackout, #login-embedded').hide('slow');"
in the iframe isn't going to do anything because those elements are on the parent page. Try this:
onclick="window.parent.jQuery('#blackout, #login-embedded').hide('slow');"
The window.parent.jQuery
bit will use the parent document's instance of jQuery to run the animation.
本文标签: javascriptClose Iframe With JqueryStack Overflow
版权声明:本文标题:javascript - Close Iframe With Jquery? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741478411a2381021.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论