1

divFancybox (v2) 使用隐藏:

<div id="embargomsg" style="display:none">
    <h1 class="entry-title">You Can't Use That Yet</h1>
    <p>That's the special stuff.</p>
    <h2 class="pitch">New to the Site?</h2>
    <p class="pitch"><a class="button secondary promo" href="/register" target="_top"><span>Get Started Today</span></a></p>
    <h2 class="pitch">Already Registered?</h2>
    <p class="pitch"><a class="button secondary action" href="/login" target="_top"><span>Log In</span></a></p>
</div><!-- #embargomsg -->

页面中其他地方带有类的各种链接authctrl应该打开fancybox...

<a class="authctrl" href="/specialstuff1">Special Stuff</a>
<a class="authctrl" href="/specialstuff2">Some Other Special Stuff</a>

...使用此功能:

$('.authctrl').click(function(e){
    e.preventDefault();
    $('#embargomsg').fancybox({
    closeClick : false
    }).trigger('click');
});

...但是当单击任何一个.authctrl链接时,Fancybox 似乎只是快速关闭并重新打开。我尝试添加closeClick: false无济于事。

4

1 回答 1

0

有没有$('#embargomsg')href?

$('.authctrl').click(function(e){
    e.preventDefault();
    $('#embargomsg').trigger('click');
});

$('#embargomsg').fancybox({
    closeClick : false
});

请提供一些标记。

于 2013-08-30T13:10:00.230 回答