-2

I am using Fancybox. The Fancybox's sample works fine, but when I bring it into my own folder, I get an issue.

If I write:

$(document).ready(

    function() {

        $('.gallery a').fancybox(
            {
                overlayColor : '#060',
                overlayOpacity : .3

            }
        );

});

The Console errors shows:

ReferenceError: $ is not defined 
$(document).ready(

The page didn't work out!

I hit F12 and check all the JS and CSS files' connections, they are connected, but I still get an error. Any idea, please.

GuRu
  • 1,880
  • 3
  • 23
  • 32
abcid d
  • 2,821
  • 7
  • 31
  • 46

1 Answers1

0

Include jquery.js at top of all javascript file

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

or if you have already added it than check your file path

rajesh kakawat
  • 10,826
  • 1
  • 21
  • 40
  • I just added your link, but it doesn't work, either. I try to delete all unrelated codes and leave only Fancybox code and the links to JS and CSS files, it doesn't work, either. – abcid d Jun 23 '14 at 05:38