Get scroll bar horizontal position
Description
The following code shows how to get the scroll bar horizontal position.
Example
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {<!--from w w w . j a va 2s . co m-->
alert($("div").scrollLeft());
});
</script>
<style>
div {
width: 200px;
height: 100px;
overflow: auto;
}
h1 {
width: 1000px;
height: 1000px;
}
</style>
</head>
<body>
<div>
<h1>java2s.com</h1>
</div>
</body>
</html>