Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  div#container { width: 200px; height: 200px; overflow: auto; }
</style>
</head>
<body>
  <div id="container" style="white-space: nowrap;">
    <div>Scroll me. DDDD</div><br />
    Scroll me.Scroll me.Scroll me.Scroll me.<br />
    Scroll me.Scroll me.Scroll me.Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br /><br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br /><br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br /><br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />Scroll me.<br />
    Scroll me.<br />
    Scroll me.<br />
  </div>
  <span id="target">1</span>
</body>
</html>
 
$(function() {
  var _t = $("#container").scrollTop();
  $("#container").scroll(function() {
    var _n = $("#container").scrollTop();
    if (_n > _t) {
      $("#target").window.scrollTo(0,400);
    } else {
      $("#target").text("Up");
    }
    _t = _n;
  });
});
function( scrollWin()
{
window.scrollTo(0,400);
}
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers