title: jQuery: fancyBox using multiple times with href?
body: <p>I have this:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
      $("a#a_test").fancybox({
          titleShow     : false,
          width:    400,
          height:   120,
          autoDimensions: false,
          overlayOpacity: 0.6,
          href: 'test.php' 
      }); 
  });
  &lt;/script&gt;
  &lt;a href="#test" id="a_test"&gt;test&lt;/a&gt;
  </code></pre>
  
  <p>This works fine.</p>
  
  <p>Now i want to use this in a loop (in php), I am wondering if i need to include the settings all the time. </p>
  
  <p>What will be different in each setting is the name(so it would be a_test1, a_test2, and so on) and the href (so it would be test.php?id=1, test.php?id=2 and so on).</p>
  
  <p>I know i just can copy paste but it would be kind of sloppy code when i view the html, a bunch of document ready, a#a_test123, a#a_test2, a#test_3 settings, couldnt I just go with one setting, and then add the number of the loop id(e.g 1,2,3) to it. Something like:</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
      $("a#a_test&lt;?php echo $number; ?&gt;").fancybox({
          titleShow     : false,
          width:    400,
          height:   120,
          autoDimensions: false,
          overlayOpacity: 0.6,
          href: 'test.php?id=&lt;?php echo $number; ?&gt;'
      }); 
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>This would work too, if I made it in a function and call it each time e.g getFancy(1), getFancy(2).. but then it would still look and be slopp coding if you take a look in the output html, a bunch of document ready with diff. settings.</p>
  
  <p>So is there a solution to do this smarter and simpler? So it gets something like a global setting for all the boxes.</p>
  
  <p>Thank you a bunch in forward</p>