Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div id="scroll" >
</div>
</body>
</html>
 
div {
  width:200px;
  height:550px;
  border-style:solid;
  overflow:scroll;
}
 
var val;
var velocity;
var count = 0;
var speed = new Array();
function report() {
val = $("#scroll").scrollTop();
 value = $("#scroll").append(val + "<br/>");
speed[count] = Number(val);
  count++;
if(count == 10){
velocity = speed[9] - speed[0];
console.log(velocity);
  count = 0;
}
}
window.setInterval("report()", 100);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
nightstalker22pro
0viewers