Hello I have several big images in my div, and one small magnifier image, which i want dynamically position in every image right-top corner. My big images are switching by clicking on them. Their sizes are different. Right now i'm trying to get every image height and width and position small image manually - is there any way to do this better?
Small magnifier image has higher z-index than the bigger ones.
MY JQUERY CODE:
$('img.small').fadeOut('fast', function() {
$('img.small').css('top',$(el).find('img.big:last').height()+60); // i want to change this
$('img.small').css('top',$(el).find('img.big:last').width()+60); // and this
$('img.small').fadeIn();
});
MY CSS:
#myGallery {
width: 100%;
height: 300px;
}
.small img{
position: absolute;
left:150px;
top:150px;
z-index: 15000;
width: 35px;
height: 35px;
}
MY HTML:
<div id="myGallery" class="spacegallery">
<img class="small" src="small.jpg" alt="" />
<img class="big" src=images/bw1.jpg alt="" />
<img class="big" src=images/bw2.jpg alt="" />
<img class="big" src=images/bw3.jpg alt="" />
</div>
Thanks!