下面是是自己写的日常普通切换动作,不知道怎么去简化,看着好冗余... 譬如怎么合并prev和next两个事件?委托于control-wrap父元素上?Live DemoHTML<div class="container">
<div class="box">1</div>
<div class="box">2</div>
<div class="box">3</div>
<div class="box">4</div>
<div class="box">5</div>
<div class="box">6</div>
<div class="box">7</div>
<div class="box">8</div>
<div class="box">9</div>
</div>
<div class="control-wrap">
<span class="prev">prev</span>
<span class="next">next</span>
</div>JS
添加回答
举报
0/150
提交
取消