简体   繁体   English

使用fancybox插件制作图片库不起作用

[英]using fancybox plugin to make an image gallery doesn't work

What's wrong with the script order given below? 下面给出的脚本顺序有什么问题? I used fancybox to view images on my website but it doesn't work. 我使用fancybox来查看网站上的图像,但是它不起作用。 Can it be that the script order is wrong or there are conflicts? 可能是脚本顺序错误或存在冲突? I want to make an image gallery with fanybox plugin. 我想使用fanybox插件制作图片库。

This is the error that I got : 这是我得到的错误:

Timestamp: 3/22/2013 2:25:05 PM Error: ReferenceError: jQuery is not defined Source File: file:///G:/LBC-FIRM/example.com/js/jquery.fancybox.js Line: 1985

This is the order of my script references: 这是我的脚本引用的顺序:

    <script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
    <script type="text/javascript" src="js/jquery.fancybox.js"></script>
    <script type="text/javascript" src="js/tooltip.js"></script>
    <script type="text/javascript" src="js/image_groups.js"></script>
    <script type="text/javascript" src="js/thumbnail-slider.js"></script>
    <script type="text/javascript">
        $.noConflict();
    </script>

My HTML: 我的HTML:

<script type="text/javascript">
    $(function(){
      $("#royal_place").click(function(){
    $.fancybox.open([
        {href : '../object/royal_palace/1.jpg'},
    {href : '../object/royal_palace/2.jpg'}, 
    {href : '../object/royal_palace/3.jpg'},
    {href : '../object/royal_palace/4.jpg'}, 
    {href : '../object/royal_palace/5.jpg'},
    {href : '../object/royal_palace/6.jpg'},
    {href : '../object/royal_palace/7.jpg'}, 
    {href : '../object/royal_palace/8.jpg'},
    {href : '../object/royal_palace/9.jpg'},
    {href : '../object/royal_palace/10.jpg'}
     ]);
      });           
   });
</script>

<a id="royal_place" href="javascript:;" >
    <img src="img/pic_tuk_tuk_1.png" alt="Tuk Tuk picture One" onmouseover="tooltip.pop(this, 'Tuk Tuk one')"/>
</a>

尝试这个

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM