change links with images

changing an image inside div - 3 examples . gallery with thumbs gallery with simple live links gallery with disabled links

HTML

<div id="gallery"> 
    <div id="panel"> 
        <img id="largeImage" src="http://placehold.it/100" /> 
        <div id="description">main image with image links</div> 
    </div> 
 
    <div id="thumbs"> 
       <img src="http://placehold.it/100/ee55ee" alt="1st image description" />
       <img src="http://placehold.it/100/080" alt="2nd image description" />
       <img src="http://placehold.it/100/ff6" alt="3rd image description" />
       <img src="http://placehold.it/100/ff3322" alt="4th image description" />
    </div> 
</div>

CSS

#thumbs ,#thumbs2, #thumbs3 {overflow: hidden; }
#thumbs img, #largeImage, #largeImage2 ,#largeImage3
{ border: 1px solid gray; padding: 4px; background-color: white; cursor: pointer; }
#thumbs img ,#thumbs2 a ,#thumbs3 a{ float: left; margin-right: 6px; }
#panel { position: relative; }

JavaScript

$('#thumbs img').click(function(){
    $('#largeImage').attr('src',$(this).attr('src').replace('thumb','large'));
});