Save jQuery data images file or open in new window
<p>I use the following jQuery to call my images, it's working fine, but I am having problem creating a download image link. I want this image to appear in a new window by clicking the download link </p>

<p>Here is my script:</p>

<pre><code>_showImagePrev = function ($item) {
  var $thumb = $item.find('img'),
  prevsrc = $thumb.data('prev');

$('&lt;img/&gt;').load(function () {
  $rgGallery.find('div.rg-image-preview').empty().append('&lt;img src="' + prevsrc + '"/&gt;');
  }).attr('src', prevsrc);
  },
</code></pre>

<p>How to use click function to load the image?</p>

<pre><code>$('#link').click(function() {     
script to load img src in new window.
});
});
</code></pre>

<p>Thanks for your help</p>
