以下是一些代码,该框显示正常但没有一个选项似乎对任何内容产生任何影响!
弹出式HTML:
<div id="fb-pop">
<div id="fb-content">
<div class="fb-txt">
<strong>Have you considered buying a license for Construct 2?</strong><br /><br />
It comes with more lots more features and possibilities. Make better games!<br />
<span class="ti">(And no more annoying messages!)</span>
</div>
<a class="get" href="REPLACEME" title="Your support is appreciated!"></a><br />
<a class="no-thx" href="javascript:void(0)" onclick="$.fancybox.close()" title="Are you sure? Upgrading your license helps support Construct 2's development!">No thanks, maybe next time!</a>
</div>
</div>
<a href="#fb-content" id="autostart"></a>
页面底部的JS:
jQuery(document).ready(function () {
$("a#autostart").fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'speedIn': 600,
'speedOut': 200,
'overlayShow': false
});
$("a#autostart").fancybox().trigger('click');
无论我在javascript中添加什么选项/属性,NOTHING似乎都在改变!它在所有浏览器中的行为方式仍然完全相同。
我正在努力使背景叠加层在点击时不会关闭fancybox(因此用户必须单击X或关闭链接)。
答案 0 :(得分:5)
你确定不是:
$("a#autostart").trigger('click');
而不是:
$("a#autostart").fancybox().trigger('click');