- 首选,我说一下我实现的思路,如下图所示:
- 代码实现:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box{
width: 500px;
height: 300px;
position: relative;
margin: 0 auto;
overflow: hidden;
}
.boxList{
width: 3500px;
height: 100%;
border: 1px solid #000;
position: absolute;
top: 0;
left: -500px;
transition: 0.5s;
}
.boxList>div{
width: 500px;
height: 300px;
float: left;
}
.ln{
width: 40px;
hei