Wrapping images with <a> jQuery problem
<p>HI all,</p>

<p>I have a bunch of images that I need to wrap in a tag and add to a tag ref from image '+big' plus use image lint as a title for link.</p>

<p>The problems I have here are, 1) Images are wrapping with this same href from first image and title attribute is not showing.</p>

<p>This is my jQuery </p>

<pre><code>$(document).ready(function(){
     var ImgLink = $('.gallery img');

     var ImgTitle = ImgLink.attr('src');

     var ImgDes = ImgLink.attr('alt')

     ImgLink.each(function(){
            $(this).wrap($('&lt;a&gt;&lt;/a&gt;')
              .attr('href', ImgTitle.replace(/\./, 'big.'), 'title'.ImgDes)
              )})

})
</code></pre>

<p>This is my HTML</p>

<pre><code>&lt;img  alt="some alt" src="1.jpg"/&gt;&lt;/a&gt;
&lt;img  alt="some other alt" src="2.jpg"/&gt;&lt;/a&gt;
&lt;img  alt="and another alt" src="3jpg"/&gt;&lt;/a&gt;
</code></pre>

<p>And this is the result</p>

<pre><code>&lt;a href="1big.jpg"&gt;&lt;img  alt="some alt" src="1.jpg"/&gt;&lt;/a&gt;
&lt;a href="1big.jpg"&gt;&lt;img  alt="some other alt" src="2.jpg"/&gt;&lt;/a&gt;
&lt;a href="1big.jpg"&gt;&lt;img  alt="and another alt" src="3.jpg"/&gt;&lt;/a&gt;
</code></pre>

<p>Thank you for your help in advance</p>
