admin管理员组

文章数量:1414605

I recently came across fancy box located here, I've followed every step in the instructions perfectly, but it doesn't work, anyone know what might be the problem?

Here is a sample of my page source:

Included the links to scripts as required, and CSS:

<script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox-1.2.1.js" type="text/javascript"></script>
    <link href="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox.css" rel="stylesheet"
        type="text/css" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />

Then this should simply work:

<a id="single_image" href="images/279641.jpg"><img src="images/279641.jpg" /></a>

But it doesn't seem to do anything except open the image in a new window.

Any suggestions, and thanks in advance.

I recently came across fancy box located here, I've followed every step in the instructions perfectly, but it doesn't work, anyone know what might be the problem?

Here is a sample of my page source:

Included the links to scripts as required, and CSS:

<script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox-1.2.1.js" type="text/javascript"></script>
    <link href="jquery.fancybox-1.2.1/jquery.fancybox/jquery.fancybox.css" rel="stylesheet"
        type="text/css" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />

Then this should simply work:

<a id="single_image" href="images/279641.jpg"><img src="images/279641.jpg" /></a>

But it doesn't seem to do anything except open the image in a new window.

Any suggestions, and thanks in advance.

Share Improve this question edited Oct 22, 2009 at 20:09 Nickolay 32.2k13 gold badges110 silver badges194 bronze badges asked Oct 22, 2009 at 19:51 JL.JL. 81.4k132 gold badges318 silver badges466 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

You forgot to implement step 4 (now step 5) from the manual, "Fire plugin using jQuery selector"

Try to include this one:

$(document).ready(function() {
 $("a#single_image").fancybox({
 'titleShow' : false
 });
});

try to look at another javascript/jquery plugin you've implemented in your html page. cause some jquery plugin has a conflict with fancybox. it works for me.

本文标签: javascriptFancy Box doesnt work please helpStack Overflow