title: Lightbox function from live jQuery call
body: <p>I have an image gallery that dynamically calls new images using jQuery, i want to lightbox these images if they are clicked.</p>
  
  <p>The problem is it seems as though the elements aren't being called by the jQuery because they need to be live calls.</p>
  
  <p>What I originally tried is this:</p>
  
  <pre><code>$(function(){
      $('a.ad-image').lightBox();
  });
  </code></pre>
  
  <p>and what i tried after, which still doesnt work is this:</p>
  
  <pre><code>$(function(){
      $('body').on('click','a.ad-image',function(e){
          e.preventDefault();
          $(this).lightBox();
      });
  });
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Lightbox: <a href="http://leandrovieira.com/projects/jquery/lightbox/" rel="nofollow">http://leandrovieira.com/projects/jquery/lightbox/</a></p>