Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head>
- <meta content="text/html; charset=UTF-8" http-equiv="content-type">
- <title> - jsFiddle demo</title>
- <script type='text/javascript' src='http://www.altesc.net/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
- <style type="text/css">
- .body { float: left; width: 200px; padding: 5px; }
- .sidebar { float: left; }
- .item { margin: 10px; width: 100px; height: 100px; background-color: black; }
- .unimportant { background-color: #ccc; height: 300px;}
- .adscrollleft { background-color: #ccc;}
- .fixedSidebar { position: fixed; top: 0; }
- </style>
- <script type="text/javascript">//<![CDATA[
- jQuery(window).load(function(){
- jQuery(document).scroll(function() {
- var useFixedSidebar = jQuery(document).scrollTop() > 330;
- jQuery('.adscrollleft').toggleClass('fixedSidebar', useFixedSidebar);
- });
- });
- //]]></script>
- </head>
- <body>
- <div class="body">
- document body.<br>
- document body..<br>
- document body...<br>
- document body....<br>
- document body.....<br>
- document body......<br>
- document body.....<br>
- document body....<br>
- document body...<br>
- document body..<br>
- document body.<br>
- document body..<br>
- document body...<br>
- document body....<br>
- document body.....<br>
- document body......<br>
- document body.....<br>
- document body....<br>
- document body...<br>
- document body..<br>
- document body.<br>
- document body..<br>
- document body...<br>
- document body....<br>
- document body.....<br>
- document body......<br>
- document body.....<br>
- document body....<br>
- document body...<br>
- document body..<br>
- document body.<br>
- document body..<br>
- document body...<br>
- document body....<br>
- document body.....<br>
- document body......<br>
- document body.....<br>
- document body....<br>
- document body...<br>
- document body..<br>
- document body.<br>
- document body..<br>
- document body...<br>
- document body....<br>
- document body.....<br>
- document body......<br>
- document body.....<br>
- document body....<br>
- document body...<br>
- document body..<br>
- document body.<br>
- </div>
- <div class="sidebar">
- <div class="adscrollleft">
- <div class="item"></div>
- <div class="item"></div>
- </div>
- </div>
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement