Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <pre>ddd
  sd
  sd
sd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  dsd
  sd
  d
  d
  d
  d
ds</pre>
  
</body>
</html>
 
html {
  height: 100%;
  width: 100%;
 // overflow: hidden;
}
body{
    margin: 0;
    min-width: 980px;
    padding: 0; 
    height: 100%;
    width: 100%;
    overflow: auto;
}
 
var iScrollPos = 0;
$(window).scroll(function () {
    var iCurScrollPos = $(this).scrollTop();
    if (iCurScrollPos > iScrollPos) {
        console.log('down');
    } else {
        console.log('up');
    }
    iScrollPos = iCurScrollPos;
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers