FancyBox根本不工作 [英] FancyBox not working at all

查看:102
本文介绍了FancyBox根本不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了让fancybox运行的问题 - 我正在运行其他一些jquery。以下是正在运行的脚本。

I'm having issues getting fancybox to run - I am running a few other jquery's too. Below are the scripts that are running.

    <!-- latest jQuery direct from google's CDN -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>

<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="../js/jquery.mousewheel.js"></script>

<!-- the jScrollPane script -->
<script type="text/javascript" src="../js/jquery.jscrollpane.min.js"></script>

<!-- EasySlider -->
<script type="text/javascript" src="../js/easySlider.js"></script>

<!-- fancybox -->
<script type="text/javascript" src="../js/fancybox/jquery.fancybox-1.3.2.pack.js"></script>

<!-- fancybox transitions -->
<script type="text/javascript" src="../js/fancybox/jquery.easing-1.3.pack.js"></script>

<script>
$(function()
{
    $('.scroll-pane').jScrollPane();
});

</script>  

<script>
$(document).ready(function(){   
    $("#slider").easySlider({
        auto: true,
        continuous: true 
    });
});

</script> 

<script>
$(document).ready(function(){   
    $("a#fancy").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });


});
</script>

这是当前(未)受影响的div。

And this is the div that's currently (not) being affected.

<div class="bodytext" style="position:absolute; left:457px; top:911px; width:468px; height:23px;">
<a id="a#fancy" href="../katie/studies/1_explorer/explorer_01.png">1</a>
&bull; 
<a id="a#fancy" href="../katie/studies/1_explorer/explorer_02.jpg">2</a>
&bull; 
<a id="a#fancy" href="../katie/studies/1_explorer/explorer_03.jpg">3</a>
</div>

由于所有其他脚本运行正常,因此不确定发生了什么。欢呼任何帮助。这可能是我忽略的一些简单:]

Not sure what's going on as all the other scripts are running fine. Cheers for any help. It's probably something simple that I'm overlooking :]

推荐答案

$(document).ready(function(){   
    $("a#fancy").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });


});

这是指ID为'fancy'的元素,而不是'a #fancy'。因此,您可以更改a标记的ID或使用a标记类而不是ID,如下所示。

this is refering to a element with ID 'fancy', not 'a#fancy'. So you could change the ID of your 'a' tag or use the 'a' tag class instead of the id as shown below.

$(document).ready(function(){   
    $("a.fancy").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });
});

和html

<div class="bodytext" style="position:absolute; left:457px; top:911px; width:468px; height:23px;">
<a class="fancy" href="../katie/studies/1_explorer/explorer_01.png">1</a>
&bull; 
<a class="fancy" href="../katie/studies/1_explorer/explorer_02.jpg">2</a>
&bull; 
<a class="fancy" href="../katie/studies/1_explorer/explorer_03.jpg">3</a>
</div>

这篇关于FancyBox根本不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆