单击精美框弹出窗口时需要弹出精美框

发布于 2025-01-08 06:09:33 字数 1332 浏览 6 评论 0原文

我有一个精美的弹出消息框,其中有一个标有“继续”的按钮。当我单击此按钮时,精美的框将关闭。我想要的是这个。我想单击“继续”按钮,并且希望关闭精美的框(就像当前一样),然后我希望在此之后弹出另一个精美的框(登录屏幕)。我有代码可以弹出登录屏幕,但不知道如何在关闭上一个花哨的框时执行此操作。我有这个带有继续按钮的精美框的代码

$.fancybox({
            'content': "<div style=\"border-width: 0px; width: 350px; height: 80px; color:#00285D; font-weight:bold;\">" + message + "<br/><br/>" + "<p class=\"center\"><a href=\"#\" onclick =\"parent.$.fancybox.close();\" class=\"btn-continue\">Continue</a></p>"
        });

我有这个用于弹出登录屏幕的代码(基于 ID 为 SignIn 的链接:

<script type="text/javascript">
        $(document).ready(function () {

            CMF.pop('#SignIn',1010,459,0,0,'iframe');
        });
    </script>  

pop 方法如下所示:

// element, width, height, padding, margin, type, refresh(enabled if undefined)
    pop: function (el, w, h, p, m, i, r) {
        $(el).fancybox({
            width: w,
            height: h,
            padding: p,
            margin: m,
            type: i,
            scrolling: 'no',
            onClosed: function () {
                if( r == undefined)
                    parent.location.reload(true);                       
            }
        });
    } // fancybox

有什么想法吗?

谢谢,

Sachin

I have a fancy box pop up message that has a button labelled 'continue'. When I click on this button the fancy box closes. What I want is this. I want to click on the continue button and I want the fancy box to close (as it currently does) then I want another fancy box to pop up after that (a sign in screen). I have code that makes the sign in screen pop up but don't know how to do this on the closing of the previous fancy box. I have this code for the fancy box with the continue button

$.fancybox({
            'content': "<div style=\"border-width: 0px; width: 350px; height: 80px; color:#00285D; font-weight:bold;\">" + message + "<br/><br/>" + "<p class=\"center\"><a href=\"#\" onclick =\"parent.$.fancybox.close();\" class=\"btn-continue\">Continue</a></p>"
        });

I have this code for popping up the sign in screen (based on a link with an id of SignIn:

<script type="text/javascript">
        $(document).ready(function () {

            CMF.pop('#SignIn',1010,459,0,0,'iframe');
        });
    </script>  

The pop method looks like this:

// element, width, height, padding, margin, type, refresh(enabled if undefined)
    pop: function (el, w, h, p, m, i, r) {
        $(el).fancybox({
            width: w,
            height: h,
            padding: p,
            margin: m,
            type: i,
            scrolling: 'no',
            onClosed: function () {
                if( r == undefined)
                    parent.location.reload(true);                       
            }
        });
    } // fancybox

Any ideas?

Thanks,

Sachin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一身仙ぐ女味 2025-01-15 06:09:33

演示页面可以帮助人们更快地回答您的问题,从而节省您和他们的时间。但无论如何.. FancyBox 显然有很多“自动”功能,因为它似乎是一个简单的图像库解决方案。

而不是调用:

parent.$.fancybox.close();

在我的示例中甚至不起作用,因为它存在于当前窗口中,而不是 window.parent 中,因此如果需要, $.fancybox.close() 就可以了。你只是想让花哨的盒子自动转换到新内容,所以只需触发这样的点击事件:

$('#SignIn').trigger('click');

一定不要调用关闭,否则它会以某种方式否定这次点击......?是的,我也认为 FancyBox 没有办法触发弹出窗口而不让你在主机项上假装“点击”,这是愚蠢的...

但直接来自马口: http://fancybox.net/blog (查看#6)

希望有帮助 -ck

A demo page would help people answer your question much quicker saving both you and them time. But anyway.. FancyBox apparently has a lot of "automatic" features since it seems to be made to be an easy image gallery solution.

Instead of calling:

parent.$.fancybox.close();

which doesn't even work in my example, because it existed in the current window, not window.parent so $.fancybox.close() would have been fine, if it was needed. you just want fancy box to auto transition to the new content so just trigger the click event like this:

$('#SignIn').trigger('click');

be sure not to call close or it negates this click somehow...? and yes, I too think it's stupid that FancyBox doesn't have a way of trigging the pop up without making you fake a "click" on the host item...

but straight from the horse's mouth: http://fancybox.net/blog (look under #6)

hope that helps -ck

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文