下面是是自己写的日常普通切换动作,不知道怎么去简化,看着好冗余... 譬如怎么合并prev
和next
两个事件?委托于control-wrap
父元素上?
<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>
相关分类