这是一些代码,该框显示正常,但所有选项似乎都不会影响任何内容!
弹出 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 中添加什么选项/属性,似乎都没有改变!它在所有浏览器中的行为方式仍然完全相同。
我试图做到这一点,以便背景叠加层在单击时不会关闭 fancybox(因此用户必须单击 X 或关闭链接)。
最佳答案
你确定不是:
$("a#autostart").trigger('click');
而不是:
$("a#autostart").fancybox().trigger('click');
关于javascript - Jquery fancybox 选项不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7959855/