2011-10-31 43 views
0

下面是一些代码,框显示正常,但没有任何选项似乎影响任何东西!jquery fancybox选项不起作用

的弹出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

'$( “#自动启动”)'应该只是罚款的选择。 – Hogan

+0

@Hogan我改变了选择器。问题是它一切正常,但如果我更改属性/选项框仍然表现完全相同。这些选项似乎对fancybox绝对没有影响。 –

+0

哦,我不认为这可以解决它,只是指出,如果你有一个ID你不需要任何其他的东西,它可能会使速度不会更快。 – Hogan

回答

5

你确定这不是:

$("a#autostart").trigger('click'); 

代替:

$("a#autostart").fancybox().trigger('click');