Created
August 21, 2014 07:02
-
-
Save yardfarmer/79ac90bb8dd7c4333c00 to your computer and use it in GitHub Desktop.
scrollLeft demo // source http://jsbin.com/vulor/2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>scrollLeft demo</title> | |
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> | |
<style id="jsbin-css"> | |
div.demo { | |
background: #ccc none repeat scroll 0 0; | |
border: 3px solid #666; | |
margin: 5px; | |
padding: 5px; | |
position: relative; | |
width: 200px; | |
height: 100px; | |
overflow: auto; | |
} | |
p { | |
margin: 10px; | |
padding: 5px; | |
border: 2px solid #666; | |
width: 1000px; | |
height: 1000px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="demo"><h1>lalala</h1><p>Hello</p></div> | |
<script id="jsbin-javascript"> | |
$( "div.demo" ).scrollLeft( 110 ); | |
$( "div.demo" ).scrollTop( 510 ); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.demo { | |
background: #ccc none repeat scroll 0 0; | |
border: 3px solid #666; | |
margin: 5px; | |
padding: 5px; | |
position: relative; | |
width: 200px; | |
height: 100px; | |
overflow: auto; | |
} | |
p { | |
margin: 10px; | |
padding: 5px; | |
border: 2px solid #666; | |
width: 1000px; | |
height: 1000px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( "div.demo" ).scrollLeft( 110 ); | |
$( "div.demo" ).scrollTop( 510 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment