本文参考了JQuery实现图片切换(自动切换+手动切换)
由于个人不需要手动切换功能,因此把那部分的内容删了,主要是增加了无缝切换的效果。
原理也很简单,大概是一张图移动到左边以后,从底部移回最右,等待下一次循环。
jquer实现图片切换
*{margin:0;padding:0;}
body{font-size:12px;color:#222;font-family:Verdana,Arial,Helvetica,sans-serif;background:#f0f0f0;}
.clearfix:after{content: ".";display: block;height: 0;clear: both;visibility: hidden;}
.clearfix{zoom:1;}
ul,li{list-style:none;}
img{border:0;}
.wrapper{width:800px;margin:0 auto;padding-bottom:50px;}
h1{height:50px;line-height:50px;font-size:22px;font-weight:normal;font-family:"Microsoft YaHei",SimHei;margin-bottom:20px;}
#focus{width:450px;height:350px;overflow:hidden;position:relative;}
#focus ul{height:380px;position:absolute;}
#focus ul li{float:left;width:450px;height:350px;overflow:hidden;position:absolute;background:#000;}
#focus ul li div{position:absolute;overflow:hidden;width: 450px;height: 350px;}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。