I use the following code to show the bigger pic.
<body>
<div id="Rand">
<a href="#" alt="img/groot/img1.jpg" id="unique name of picture" class="BiggerPic">
<img src="img/thumb/img1.jpg" />
</a>
<a href="#" alt="img/groot/img2.jpg" id="unique name of picture" class="BiggerPic">
<img src="img/thumb/img2.jpg" />
</a>
<a href="#" alt="img/groot/img2.jpg" id="unique name of picture" class="BiggerPic">
<img src="img/thumb/img2.jpg" />
</a>
</div>
<div id="ShowBiggerDivIMG" style="display: none;">
<img id=ShowBiggerIMG src="" />
</div>
</body>
$(document).ready(function(){
var imgScr = $('.BiggerPic').prev('a').attr('alt');
$('.ImageMagnifier').click(function(){
$('#ShowBiggerDivIMG').fadeIn(600);
$('#ShowBiggerIMG').attr('src', imgScr);
})
});
The only thing he return is the last link of the last picture. How do i get the alt (link) of the activ clicked Thumbnail to replace with the src of img(#ShowBiggerIMG)?