关闭jQuery fancybox的问题 [英] Problem with closing jQuery fancybox

查看:65
本文介绍了关闭jQuery fancybox的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,



我有一个网站在jQuery fancybox中打开一个iframe。在iframe内部存在一个具有表单的ASP页面。我的问题是,提交表单时,fancybox不会关闭。我知道提交不会自动关闭它,但我尝试了许多不同的方法来实现这一点。



以下是我试过的代码:

Good day,

I have a website that opens an iframe inside a jQuery fancybox. Inside the iframe exists an ASP page that has a form. My problem is that when the form is submitted, the fancybox does not close. I know "submit" does not automatically close it, but I have tried many different ways to accomplish this.

Below is the code I have tried:

<script language="JavaScript" type="text/javascript">

    $(function closefancybox() {
        window.parent.jQuery.fn.fancybox.close();
    });    
</script>

<input name="Submit" type="submit" class="style70" value="Submit" onclick="closefancybox()" />





我承认我对JavaScript和jQuery的无知,我只是在寻找一些建议。谢谢!



I admit my ignorance in JavaScript and jQuery and am just looking for some suggestions. Thank you!

推荐答案

(函数closefancybox(){
window.parent.jQuery.fn.fancybox.close();
}) ;
< / script>

< input name =Submittype =submitclass =style70value =Submitonclick =closefancybox()/>
(function closefancybox() { window.parent.jQuery.fn.fancybox.close(); }); </script> <input name="Submit" type="submit" class="style70" value="Submit" onclick="closefancybox()" />





我承认我对JavaScript和jQuery的无知,我只是在寻找一些建议。谢谢!



I admit my ignorance in JavaScript and jQuery and am just looking for some suggestions. Thank you!


我不确定是什么花哨的盒子......让我假设这是一个JQUERY对话框...



你有这样的设计...



Page1 - >根据任何操作,您的对话框正在打开。在该对话框中,您有一个包含另一个aspx页面的IFrame,比如Page2。在Page1中,你的JQUERY DIALOG是由id为#dialog的div制作的。



Page2 - >添加以下js代码点击提交按钮。



parent。
I am not sure what a fancy box is... let me assume that is a JQUERY DIALOG BOX...

Have your design like this...

Page1 --> based on any action, your dialog is opening. Inside that dialog you have an IFrame containing another aspx page, say Page2. In Page1, your JQUERY DIALOG is made from the div having id #dialog.

Page2 --> add the following js code onclick of submit button.

parent.


(#dialog)。dialog('close ');



因此,当您从IFrame中提交Page2中的按钮时,Iframe的父级(对话框)将被关闭。



请回复它解决您的问题。



谢谢。
("#dialog").dialog('close');

So, when you submit the button in Page2 from the IFrame, the parent of the Iframe (which is the dialog) will get closed.

Please reply back it it solves your problem.

Thank you.


这篇关于关闭jQuery fancybox的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆