关闭色箱 [英] Closing Colorbox

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

问题描述

我有一个简单的弹出窗口(不是iframe),用户可以在其中相互发送邮件.有一个用于发送信息的提交按钮和一个应关闭覆盖图的取消按钮.

I have a simple popup (not an Iframe) where a user can send mail to each other. There is a submit button to send the information and a cancel button which should close the overlay.

让关闭按钮正常工作确实有些麻烦.

I do have some trouble getting the close button to work.

代码如下:

<asp:Button runat="server" ID="btnCancel" Text="Cancel" />

<script type="text/javascript">
    jQuery(document).ready(function () {
        jQuery("#<%= btnCancel.ClientID %>").click(function () {
            jQuery.colorbox.close(); return false;
        });
    });
</script>

我曾尝试使用parent.jQuery.colorbox.close()和jQuery.fn.colorbox.close(),但都没有成功.

I have tried with both parent.jQuery.colorbox.close(), jQuery.fn.colorbox.close() but with no success.

推荐答案

我发现我两次添加了jQuery和colorbox,因为它既加载在框架中,又加载在调用colorbox的页面上.

I found out that I was adding jQuery and colorbox twice, since it was loaded both in the frame and the on the page calling colorbox.

在我从覆盖页面中删除了jQuery和Colorbox之后,它就起作用了,所以只包含了它.

It worked after I removed jQuery and Colorbox from the overlay page, so it only got included.

我使用了"sushil bharwani"的想法,并执行了关闭事件.

I used 'sushil bharwani' idea, and executed the close event.

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

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