Lightbox and dynamic links - how and why does this work?
<p>I had a problem, was going to ask how to fix it, but then the answer popped up in a related question. Seeing I have little experience with jQuery, I would like to understand exactly "what" happens with what I'm doing.</p>

<p>FYI: jQuery (latest) + jCarousel + Lightbox.</p>

<p>jCarousel creates a few links for me, and Lightbox captures these links and shows a nice frame around the picture I linked.</p>

<p>The code that did the trick was</p>

<pre><code>$('a.gallery').live("click", function(e) {
    $(this).lightBox({
        imageLoading : 'img/lightbox-ico-loading.gif',
        imageBtnClose : 'img/lightbox-btn-close.gif',
        imageBtnPrev : 'img/lightbox-btn-prev.gif',
        imageBtnNext : 'img/lightbox-btn-next.gif'
    });
    $(this).triggerHandler('click');
    e.preventDefault();
});
</code></pre>

<p>..instead of</p>

<pre><code>$('a.gallery').lightBox({
    imageLoading : 'img/lightbox-ico-loading.gif',
    imageBtnClose : 'img/lightbox-btn-close.gif',
    imageBtnPrev : 'img/lightbox-btn-prev.gif',
    imageBtnNext : 'img/lightbox-btn-next.gif'
});
</code></pre>

<p>My question is; what is the exact difference between these?</p>

<p>Thanks alot</p>
