javascriptjqueryfancyboximage-gallery

fancybox, open gallery on click


I`m not sure, maybe this question is already answered or there is some similar, but I hope that this will be the easiest way for me, to figure out this problem.

So I have this code in my "head" tag:

<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>


<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<link rel="stylesheet" href="js/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />

<script type="text/javascript">

$(document).ready(function() {

    $(".fancybox").fancybox();

            $("#fb_man").click(function() {
            $.fancybox.open([
                {
                    href : 'both.jpg',
                    title : 'My title'
                }, {
                    href : 'front.jpg',
                    title : '2nd title'
                }
            ], {
                helpers : {
                    thumbs : {
                        width: 75,
                        height: 50
                    }
                }
            });
        });


});
</script>

And this one in my body:

<a id="fb_man" href="javascript:;"><img src="img/eyey.png"></a>

I want to open a gallery of 2 images (both.jpg and front.jpg) by clicking on eyey.png, but I get this error:

Uncaught TypeError: $.fancybox.open is not a function

How can I solve this error?


Solution

  • just change this part from

    $.fancybox.open([
    

    to

    $.fancybox([