用CSS做滑动效果的图片画廊
2006-06-13 19:22:33 来源:WEB开发网核心提示:代码如下: 以下是引用片段:<style>#galleryh { padding:0; margin:0 auto 5em auto; list-style-type:none; overflow:hidden; width:495px; height:240px; border:
代码如下: 以下是引用片段:
<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(/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://www.cncms.com/imagelist/06/24/433movw9ni5t.jpg" alt="#1" title="#1" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/5j2s3486qur7.jpg" alt="#2" title="#2" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/6g5c95l21jr0.jpg" alt="#3" title="#3" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/vt3bd2g7qyqk.jpg" alt="#4" title="#4" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/90850kbw77is.jpg" alt="#5" title="#5" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/7a3sv6r1j4ak.jpg" alt="#6" title="#6" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/7ej8grn86b3u.jpg" alt="#7" title="#7" /></a></li>
</ul>
<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(/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://www.cncms.com/imagelist/06/24/433movw9ni5t.jpg" alt="#1" title="#1" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/5j2s3486qur7.jpg" alt="#2" title="#2" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/6g5c95l21jr0.jpg" alt="#3" title="#3" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/vt3bd2g7qyqk.jpg" alt="#4" title="#4" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/90850kbw77is.jpg" alt="#5" title="#5" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/7a3sv6r1j4ak.jpg" alt="#6" title="#6" /></a></li>
<li><a href="#nogo">
<img src="http://www.cncms.com/imagelist/06/24/7ej8grn86b3u.jpg" alt="#7" title="#7" /></a></li>
</ul>
更多精彩
赞助商链接