今天在实现div滚动条两侧的按键的时候,出现了一个问题。问题是:滚动条两侧按键的js注释后,中间滚动条就可以用鼠标拖动,当取消注释,中间的滚动条就无法就鼠标拖动。
<div id="btnleft">
<img src="images/arrow-left.png" style="width: 20px; height: 16px;" />
</div>
<div class="spec-scroll open inited" id="spec-scroll">
<div class="spec-scroll-control" id="dv" style="width: 255px; transform: translate3d(0,0,0)"></div>
</div>
<div id="btnright" >
<img src="images/arrow-right.png" style="width: 20px; height: 16px;" />
</div>
<script type="text/javascript">
window.onload = function () {
中间滚动条的js
}
</script>
<script type="text/javascript">
window.onload = function () {
两侧按键的js
}
</script>