//横向滚动条同步 <div id="div1" style="width:500px; overflow:scroll;" onscroll="document.getElementById('div2').scrollLeft = this.scrollLeft;"> <div style="width:800px; height:50px;"></div> </div> <div id="div2" style="width:500px; overflow:scroll;" onscroll="document.getElementById('div1').scrollLeft = this.scrollLeft;"> <div style="width:800px; height:50px;"></div> </div>
//竖向滚动条同步 <div id="div1" style="width:500px; overflow:scroll;" onscroll="document.getElementById('div2').scrollTop = this.scrollTop;"> <div style="width:800px; height:50px;"></div> </div> <div id="div2" style="width:500px; overflow:scroll;" onscroll="document.getElementById('div1').scrollTop = this.scrollTop;"> <div style="width:800px; height:50px;"></div> </div>
|