效果:

要点:闭包理解;轮询器的清除;
以下为部分代码,所有代码见github(ImageEffect文件夹):https://github.com/ChpShy/single-play-demo/tree/master/ImageEffect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>banner实现</title>
<style>
* {
margin: 0;
padding: 0;
}
h1,
p {
text-align: center;
}
ul {
width: 1200px;
overflow: hidden;
margin: 50px auto;
list-style: none;
}
ul li {
float: left;
width: 240px;
}
.pic1,
.pic2,
.pic3,
.pic4,
.pic5 {
width: 100%;
height: 400px;
}
.pic1 {
background: url('img/1.jpg') no-repeat center 0;
}

最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



