和小米官网轮播图是一样的效果,需要的小伙伴拿走不谢,附上源码下载链接https://github.com/luoyu6/slideshow_xiaomi
注意:写的时候唯一需要的就是布局的时候li元素 需要设置成 position: absolute;不然轮播的时候有一段时间出现空白!
以下是效果图(没有动图,只有效果图,凑合看吧 尴尬~~)
代码如下
<!DOCTYPE HTML>
<html>
<head>
<title>please enter your title</title>
<meta charset="utf-8">
<meta name="Author" content="luoyu">
<style type='text/css'>
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
#banner {
width: 730px;
height: 454px;
margin: 50px auto;
position: relative;
}
#banner .pic {
width: 100%;
height: 100%;
position: relative;
}
#banner .pic ul li {
position: absolute;
display: none;
}
#banner .tab {
width: 148px;
height: 20px;
position: absolute;
bottom: 10px;
&