函数防抖
用手风琴案例演示,做防抖优化前和优化后的区别
简易手风琴案例(防抖优化前 )
图片资源地址:https://github.com/jiang-zi/Optimize-anti-shake-/tree/master/images
<style>
ul {
list-style: none;
}
* {
margin: 0;
padding: 0;
}
div {
width: 1200px;
height: 400px;
margin: 50px auto;
border: 1px solid red;
overflow: hidden;
}
div li {
width: 240px;
height: 400px;
float: left;
transition: all 500ms;
}
div ul {
width: 1200px;
}
</style>
</head>
<body>
<div id="box">
<ul>
<li>
<a href="#">
<img src="./images/1.jpg" alt="" />
</a>
</li&g