title: fancybox ajax image gallery
body: <p>Im am trying to load a fancybox image gallery via ajax. It's my first time using fancybox and my jquery knowledge is limited.
  Here's what I have put together so far. Gallery link;</p>
  
  <pre><code>&lt;a class="fancybox" href="galleryAj.php?galid=641"&gt;&lt;img src="http://www.urllinktomyimage/4451_641.jpg" alt="#" height="140" width="210"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>the galleryAj.php echos a list of image links as follows;</p>
  
  <pre><code>&lt;a class="fancybox" rel="gallery1" href="../images/4451_641.jpg" title=""&gt;&lt;img src="../images/4451_641.jpg" alt="" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>And here's the javascript</p>
  
  <pre><code>$(document).ready(function() {
  $(".fancybox")
      .attr('rel', 'gallery1')
      .fancybox({
          type: 'ajax',
          padding : 0
      });
  });
  </code></pre>
  
  <p>When I click the gallery link, all of the images appear in a single window next to each other, not as a slide show.
  I have trawled Google and stack overflow for answers without success. Hope someone can help.
  Thanks in advance.</p>