微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

避免提交后关闭fancybox iframe?

如何解决避免提交后关闭fancybox iframe?

| 这真的很奇怪,并且不应该这样发生,而是这样。 我称呼我的FB:
 <p>Haz <a class=\"recupera\" href=\"recover.PHP\">click aquí</a> si has olvidado tu contraseña.</p>

 $(\"a.recupera\").fancybox({
        \'scrolling\'     : \'no\',\'titleShow\'     : false
    });
在recover.PHP中,我有一个表单,我在那里处理所有事情,当我在浏览器中打开它时它可以工作,并且一切正常:
<?
//DOCTYPE and all that jazz here
if(!empty($_POST[\'email\'])){

//does stuff in DB

}else{
 ?>
 <div id=\"logeando\">
<h2 class=\"titulo-cufon\">Recuperar contraseña</h2>
<form method=\"post\" action=\"\" id=\"loginform\">
<fieldset>
    <label class=\"titulo-cufon\" for=\"email\">E-mail:</label>
    <input type=\"text\" name=\"email\" id=\"email\" /><br />

    <input type=\"submit\" name=\"register\" id=\"register\" class=\"large button gray input\" value=\"Enviar\" />
</fieldset>
</form>
 </div>
 <?}?>
每次我单击“提交”按钮时,我的幻想框都会关闭。这是iframe,为什么要这么做?我该如何预防?是我提交的,但是在关闭时?根据我所读的内容,人们通常会要求对方(提交后iframe关闭,而不是阻止它)     

解决方法

        指定fancybox在iframe中运行。
 $(\"a.recupera\").fancybox({
        \'scrolling\'     : \'no\',\'titleShow\'     : false,\'type\'      : \'iframe\'
    });
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。