用CSS做滑動效果的圖片畫廊
代碼如下:
以下是引用片段:
<style>
#galleryh {
padding:0;
margin:0 auto 5em auto;
list-style-type:none;
overflow:hidden;
width:495px;
height:240px;
border:1px solid #888;
background:#fff url(http://soft.yesky.com/imagelist/06/24/o9642o826u4n.gif);
}
#galleryh li {
float:left;
}
#galleryh li a {
display:block;
height:240px;
width:28px;
float:left;
text-decoration:none;
border-right:1px solid #fff;
cursor:default;
}
#galleryh li a img {
width:28px;
height:240px;
border:0;
}
#galleryh li a:hover {
background:#eee;
width:320px;
}
#galleryh li a:hover img {
width:320px;
}
</style>
以下是引用片段:
<ul id="galleryh">
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/433movw9ni5t.jpg" alt="#1" title="#1" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/5j2s3486qur7.jpg" alt="#2" title="#2" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/6g5c95l21jr0.jpg" alt="#3" title="#3" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/vt3bd2g7qyqk.jpg" alt="#4" title="#4" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/90850kbw77is.jpg" alt="#5" title="#5" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/7a3sv6r1j4ak.jpg" alt="#6" title="#6" /></a></li>
<li><a href="#nogo">
<img src="http://soft.yesky.com/imagelist/06/24/7ej8grn86b3u.jpg" alt="#7" title="#7" /></a></li>
</ul>