title: Why isn't my fancybox function working?
body: <p>Forgive me if this is something obvious but I cannot get my fancybox to work.  I know my custom javascript is adding the proper class &amp; href attribute to the preview image but for some reason the browser is not recognizing my fancybox function. When I inspect the page with the Chrome DevTool it gives me the error of <strong>"Uncaught TypeError:undefined is not a function"</strong>, which I think means that the parser is not recognizing the <code>.fancybox()</code> function.  Is it possible that my fullsize images are too big? I'm sure it is something obvious but if anyone could enlighten me as to the error is would be very much appreciated. </p>
  
  <p>Here is my website:<a href="http://rbrewer.mydevryportfolio.com/gallery/photos.html" rel="nofollow">Here</a></p>
  
  <p>Here is my HTML: </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;!-- Always force latest IE rendering engine (even in intranet) &amp; Chrome Frame
  Remove this if you use the .htaccess --&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /&gt;
  &lt;meta name="description" content="" /&gt;
  &lt;meta name="author" content="Brewmaster" /&gt;
  &lt;meta name="viewport" content="width=device-width; initial-scale=1.0" /&gt;
  
  &lt;title&gt;Ryan M Brewer&lt;/title&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="includes/jquery.fancybox-   1.3.4/fancybox/jquery.fancybox-1.3.4.css" media="screen" /&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Poller+One' rel='stylesheet' type='text/css'/&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/&gt;
  
  &lt;link rel="stylesheet" type="text/css" href="includes/gallery.css" /&gt;
  &lt;link rel="stylesheet" href="../css/main-styles.css" type="text/css" /&gt;
  
  
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt; &lt;/script&gt;
  &lt;script type="text/javascript" src="includes/farinspace/jquery.imgpreload.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="includes/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"&gt;&lt;/script&gt;
  
  
  &lt;!-- Replace favicon.ico &amp; apple-touch-icon.png in the root of your domain and delete these references --&gt;
  &lt;link rel="shortcut icon" href="images/favicon.ico" /&gt;
  &lt;link rel="apple-touch-icon" href="/apple-touch-icon.png" /&gt;
  &lt;!--[if lt IE 9]&gt;
  &lt;script src="js/ieshim/dist/html5shiv.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  &lt;script type="text/javascript" src="includes/gallery.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body onLoad=""&gt;
  &lt;div class="contain"&gt;
  &lt;header id="header"&gt; 
    &lt;div id="topSpacer"&gt;&lt;/div&gt;
    &lt;div id="topbar"&gt;
    &lt;div class="topnav-container"&gt;
            &lt;nav class="topnav-left"&gt;
               &lt;ul&gt;
                &lt;li&gt;&lt;a href="../index.html"&gt;HOME&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="../index.html#about"&gt;ABOUT ME&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="../index.html#contact"&gt;CONTACT ME&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/nav&gt;
            &lt;nav class="topnav-right"&gt;
               &lt;ul&gt;
                &lt;li&gt;&lt;a href="webdesign.html"&gt;WEB DESIGN&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="#"&gt;PHOTOS&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href="graphics.html"&gt;GRAPHICS&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/nav&gt;
            &lt;nav id="mobile-menu-tablet"&gt;
              &lt;button id="menuButton"&gt;MENU&lt;/button&gt;
              &lt;ul&gt;
        &lt;li&gt;&lt;a href="#"&gt;HOME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;ABOUT ME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;CONTACT ME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;WEB DESIGN&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;PHOTOS&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;VIDEOS&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
            &lt;/nav&gt;
            &lt;nav id="mobile-menu-phone"&gt;
              &lt;button id="mobileMenuButton"&gt;MENU&lt;/button&gt;
              &lt;ul&gt;
        &lt;li&gt;&lt;a href="#"&gt;HOME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;ABOUT ME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;CONTACT ME&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;WEB DESIGN&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;PHOTOS&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;VIDEOS&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
            &lt;/nav&gt;
            &lt;div class="logo-container"&gt;&lt;a href="#"&gt;&lt;/a&gt;&lt;/div&gt;
    &lt;/div&gt; &lt;!--Closes topnav-container--&gt;
    &lt;/div&gt; &lt;!--Closes topbar--&gt;
  &lt;/header&gt;
  &lt;body&gt;
  &lt;div class="gallery_container"&gt;
  &lt;div class="gallery_credit"&gt;&lt;h1&gt;My Photography&lt;/h1&gt;&lt;/div&gt;
      &lt;div class="clear_both"&gt;&lt;/div&gt;
      &lt;div class="gallery_content"&gt;
          &lt;div class="gallery_thumbnails"&gt;
              &lt;a href="images/gallery/fireboat_fullsize.jpg" title="'Fireboat', Collection: Architecture"&gt;&lt;img src="images/gallery/fireboat_thumbnail.jpg"/&gt;&lt;/a&gt;
              &lt;a href="images/gallery/windows_fullsize.jpg" title="'Windows', Collection: Architecture"&gt;&lt;img src="images/gallery/windows_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/capitolflower_fullsize.jpg" title="'Capitol Flower', Collection: Architecture"&gt;&lt;img src="images/gallery/capitolflower_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/caughtintheteeth_fullsize.jpg" title="'Caught In The Teeth', Collection: Nature"&gt;&lt;img src="images/gallery/caughtintheteeth_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/crimsonbloom_fullsize.jpg" title="'Crimson Bloom', Collection: Nature"&gt;&lt;img src="images/gallery/crimsonbloom_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/familyisbeautiful_fullsize.jpg" title="'Family Is Beautiful', Collection: People"&gt;&lt;img src="images/gallery/familyisbeautiful_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/fanme_fullsize.jpg" title="'Fan Me', Collection: People"&gt;&lt;img src="images/gallery/fanme_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/flutterby_fullsize.jpg" title="'Flutterby', Collection: Nature"&gt;&lt;img src="images/gallery/flutterby_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/lightlyd_fullsize.jpg" title="'Light Lyd', Collection: People"&gt;&lt;img src="images/gallery/lightlyd_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/nicedew_fullsize.jpg" title="'Nice Dew', Collection: Nature"&gt;&lt;img src="images/gallery/nicedew_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/orangedream_fullsize.jpg" title="'Orange Dream', Collection: Nature"&gt;&lt;img src="images/gallery/orangedream_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/papabuddha_fullsize.jpg" title="'Papa Buddha', Collection: People"&gt;&lt;img src="images/gallery/papabuddha_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/pinkflamingos_fullsize.jpg" title="'Pink Flamingos', Collection: People"&gt;&lt;img src="images/gallery/pinkflamingos_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/redleaf_fullsize.jpg" title="'Red Leaf', Collection: Nature"&gt;&lt;img src="images/gallery/redleaf_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/satchel_fullsize.jpg" title="'Satchel', Collection: People"&gt;&lt;img src="images/gallery/satchel_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/scenicview_fullsize.jpg" title="'Scenic View', Collection: Architecture"&gt;&lt;img src="images/gallery/scenicview_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/stemout_fullsize.jpg" title="'Stem Out', Collection: Nature"&gt;&lt;img src="images/gallery/stemout_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/theroadatnight_fullsize.jpg" title="'The Road At Night', Collection: Nature"&gt;&lt;img src="images/gallery/theroadatnight_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/willitsfog_fullsize.jpg" title="'Willits Fog', Collection: Nature"&gt;&lt;img src="images/gallery/willitsfog_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;a href="images/gallery/lightways_fullsize.jpg" title="'Lightways', Collection: Architecture"&gt;&lt;img src="images/gallery/lightways_thumbnail.jpg"/&gt;&lt;/a&gt;
                  &lt;div class="clear_both"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="gallery_preview"&gt;
                  &lt;a href="images/gallery/acrobats_large.jpg"&gt;&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="clear_both"&gt;&lt;/div&gt;
              &lt;div class="gallery_contact"&gt;&lt;p&gt;&lt;a class="contactLink" href="mailto:info@lynda.com"&gt;Contact Me&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
              &lt;div class="gallery_caption"&gt;&lt;/div&gt;
              &lt;div class="clear_both"&gt;&lt;/div&gt;
              &lt;div class="gallery_preload_area"&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;div class="spacer"&gt;&lt;/div&gt;            
  
  
  &lt;/body&gt;
  &lt;footer&gt;
  &lt;p&gt;&amp;copy; Copyright 2013 - Ryan Michael Brewer&lt;/p&gt;
  &lt;/footer&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my custom Javascript:</p>
  
  <pre><code>$(document).ready(function() {
  
  // Set these DIVs to show for browsers suporting JavaScipt
  $('.gallery_data').css('display','block');
  $('.gallery_thumbnails').css('width','500px');
  $('.gallery_preview').css('display','block');
  $('.gallery_caption').css('display','block');
  
  // Capture the thumbnail links
  $('.gallery_thumbnails a').click(function(e){
  
      // Disables standard link behavior
      e.preventDefault();
  
      // Sets up variables based on linked thumbnails
      var photo_caption = $(this).attr('title');
      var photo_fullsize = $(this).attr('href');
      var photo_preview = photo_fullsize.replace("_fullsize", "_preview");
  
      // Fade out preview, preload new image, fade preview back in
      $('.gallery_caption').slideUp(500);
      $('.gallery_preview').fadeOut(500, function(){
  
          $('.gallery_preload_area').html('&lt;img src="'+photo_preview+'" /&gt;');
          $('.gallery_preload_area img').imgpreload(function(){
              $('.gallery_preview').html('&lt;a class="overlayLink" title="'+photo_caption+'" href="'+photo_fullsize+'" style="background-image:url('+photo_preview+');"&gt;&lt;/a&gt;');
              $('.gallery_preview').fadeIn(500);
              $('.gallery_caption').html('&lt;p&gt;&lt;a class="overlayLink zoom" title="'+photo_caption+'" href="'+photo_fullsize+'"&gt;View larger&lt;/a&gt;&lt;/p&gt;&lt;p&gt;'+photo_caption+'&lt;/p&gt;');
              $('.gallery_caption').slideDown(500);
              setFancyBoxLinks();
              updateThumbnails();
          });
  
      });
  
  });
  
  // Set the first preview image
  var first_photo_caption = $('.gallery_thumbnails a').first().attr('title');
  var first_photo_fullsize = $('.gallery_thumbnails a').first().attr('href');
  var first_photo_preview = first_photo_fullsize.replace("_fullsize", "_preview");
  $('.gallery_preview').html('&lt;a class="overlayLink" title="'+first_photo_caption+'" href="'+first_photo_fullsize+'" style="background-image:url('+first_photo_preview+');"&gt;&lt;/a&gt;');
  $('.gallery_caption').html('&lt;p&gt;&lt;a class="overlayLink zoom" title="'+first_photo_caption+'" href="'+first_photo_fullsize+'"&gt;View larger&lt;/a&gt;&lt;/p&gt;&lt;p&gt;'+first_photo_caption+'&lt;a href="'+first_photo_fullsize+'" style="background-image:url('+first_photo_preview+');"&gt;&lt;/a&gt;&lt;/p&gt;');
  updateThumbnails();
  setFancyBoxLinks();
  
  });
  
  function setFancyBoxLinks(){
  // Links for Fancybox
  $("a.overlayLink").fancybox({
      'titlePosition' : 'over',
      'overlayColor' : '#000',
      'overlayOpacity' : 0.8,
      'transitionIn' : 'elastic',
      'transitionOut' : 'elastic',
      'autoScale' : true
  });
  }
  
  function updateThumbnails(){
  $('.gallery_thumbnails a').each(function(index){
  
      if ( $('.gallery_preview a').attr('href') == $(this).attr('href') ){
          $(this).addClass('selected');
          $(this).children().fadeTo(250, .4);
      }else {
          $(this).removeClass('selected');
          $(this).children().css('opacity', '1');
      }
  });
  
  }
  </code></pre>