JQuery plugin namespaces and iterators
<p>I write this code:</p>

<pre><code>(function($) {
    $.fn.extend({
        videoGallery: function() {

            this.each(function() {

                gallery = $(this); // present object in the $.each iteretor

                $(this).find('a').click(function(e){
                    e.preventDefault();
                    alert( gallery.attr('id') );
                });             


            });                                     
        }
    });
})(jQuery);

$('.video-gallery').videoGallery();
</code></pre>

<p>Why, when I click on "a" element, the var gallery have always the same value and it's correspond to the last gallery in the <code>$.each</code> iteretor?</p>

<p>Thanks, and sorry for my English, it's not my natural language</p>
