div
Fancybox (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
无济于事。