SHARE
TWEET

Untitled

a guest Feb 10th, 2013 57 Never
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function OnScrollDiv() {
  5.     var div1 = document.getElementById("div1");
  6.     var div2 = document.getElementById("div2");
  7.     div2.scrollTop = div1.scrollTop * 2;
  8.     alert(div1.scrollTop);
  9.     alert(div2.scrollTop);
  10. }
  11. </script>    
  12. </head>
  13. <body>
  14.     <div style="width: 250px; height: 250px; overflow: scroll; float: left;" id="div1" onscroll="OnScrollDiv();">1 i dont know whhy i am typing this<br>2 i dont know whhy i am typing this<br>3 i dont know whhy i am typing this<br>4 i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>i dont know whhy i am typing this<br>
  15.     </div>
  16.     <div style="width: 150px; height: 250px; overflow: scroll; float: left;" id="div2">1 Start of div2<br>2 Start of div2<br>3 Start of div2<br>4 Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>Start of div2<br>
  17.     </div>
  18. </body>
RAW Paste Data
Top