FancyBox 根本不工作

发布于 2024-09-30 02:58:00 字数 1968 浏览 8 评论 0原文

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

    <!-- 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。

<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>

不确定发生了什么,因为所有其他脚本都运行良好。为任何帮助干杯。这可能是我忽略的简单事情:]

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>

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>
• 
<a id="a#fancy" href="../katie/studies/1_explorer/explorer_02.jpg">2</a>
• 
<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 :]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱桃奶球 2024-10-07 02:58:00
$(document).ready(function(){   
    $("a#fancy").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });


});

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

$(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>
• 
<a class="fancy" href="../katie/studies/1_explorer/explorer_02.jpg">2</a>
• 
<a class="fancy" href="../katie/studies/1_explorer/explorer_03.jpg">3</a>
</div>
$(document).ready(function(){   
    $("a#fancy").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });


});

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
    });
});

and 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>
• 
<a class="fancy" href="../katie/studies/1_explorer/explorer_02.jpg">2</a>
• 
<a class="fancy" href="../katie/studies/1_explorer/explorer_03.jpg">3</a>
</div>
生死何惧 2024-10-07 02:58:00

a 指的是 html 标签,其中 fancy 是您尝试选择的元素的实际标签。

a refers to the html tag where fancy is the actual tag of the element that you are trying to select.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文