Advertisement
Guest User

Untitled

a guest
Dec 29th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. function sticky_relocate() {
  4. var window_top = jQuery(window).scrollTop();
  5. var div_top = jQuery('#main').offset().top;
  6. if (window_top > div_top)
  7. jQuery('.adscrollleft').addClass('fixedsidebar')
  8. else
  9. jQuery('.adscrollleft').removeClass('fixedsidebar');
  10. }
  11. // If you have jQuery directly, use the following line, instead
  12. jQuery(function() {
  13. // If you have jQuery via Google AJAX Libraries
  14. // google.setOnLoadCallback(function() {
  15. jQuery(window).scroll(sticky_relocate);
  16. sticky_relocate();
  17. });
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement