看演示
HTML
<div id="content">
<div id="mainImg"><img src="http://youchew.net/wiki/images/9/9c/One.png" /></div>
<div id="allImg">
<img src="http://youchew.net/wiki/images/9/9c/One.png" >
<img src="http://seo-hacker.com/wp-content/uploads/2010/04/22.png" >
<img src="http://webtrafficnews.com/wp-content/uploads/2012/03/3.png" >
</div>
</div>
CSS
#content {width:300px;border:solid 1px #f00;overflow:auto; margin:0 auto;}
#allImg {}
#allImg img{ float:left; width:30%;opacity:.5; cursor:pointer; margin:5px}
jQuery
$(function(){
$("#allImg").on("click","img",function(){
$("#mainImg img").prop("src",$(this).prop("src"));
});
});
编辑:
更新了幻灯片演示
CSS
#mainImg {width:300px; height:300px;}
jQuery
$("#allImg").on("click","img",function(){
newImage = $(this);
$("#mainImg img").slideUp(500,function()
{
$("#mainImg img").prop("src",newImage.prop("src"));
$("#mainImg img").slideDown(500);
});
});