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!
Your 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With