Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
    
    <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
  
  <style>
    #scrollbar {
    margin-top: 10px;
    height: 220px;
    float: right;
    overflow-y: scroll;
    line-height: 403px;
}
  </style>
    
</head>
<body>
    <div id="scrollbar">&nbsp;</div>
  <script>
        var lastScroll = 0;
$("#scrollbar").scroll(function () {
                // Sets the current scroll position
                var st = $(this).scrollTop();
                if (st > lastScroll) {
                    // downward scrolling
                    console.log("scrolling down!");
                } else {
                    //upward scrolling
                    console.log("scrolling up!");
                }
                lastScroll = st;
            });
    </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
abertolipro
0viewers