这是我的HTML:
<div id="show">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR51FTd5w9iwfz_PLnUTUIbYBB0bCX6d3ue1ZSx3SJObNLGECEm"
>
</div>
<div id="thumbnails">
<div id="thumbnail1">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTPIzMxDNjQ_x4iUZ6WLo9R32QKCreu8PQGxcRHWmUw4hNcYmiR"
width="100" height="100">
</div>
<div id="thumbnail2">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR51FTd5w9iwfz_PLnUTUIbYBB0bCX6d3ue1ZSx3SJObNLGECEm"
width="100" height="100">
</div>
<div id="thumbnail3">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsplNlIS3zRyy89UxlT5Nwu_Bn7m6w7iqMYXPF9q9MpLOG17XR"
width="100" height="100">
</div>
我的CSS:
#thumbnails div {
float:left;
border:1px solid;
}
#thumbnails div:hover {
color:yellow;
}
因此,我只想div #show
在单击时更改其下方的任何缩略图。我已经尝试使用jQuery .attr('src', 'url');
它,但效果不佳。
小提琴:http: //jsfiddle.net/PemHv/
谢谢