<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'>
$(window).load(function(){
$(window).scroll(function() {
console.log($(this).scrollTop());
$('#myElement').css('bottom', -1*$(this).scrollTop() + "px");
});
});
</script>
</head>
<body>
<div style='height: 1000px;background:#EEE'>something for making scrollbars</div>
<div id="myElement" style="position: absolute; bottom: 0px;">This
stays at the top</div>
</body>
</html>
The code above is rendered as follows: