Posted By

jackkeller on 11/01/11


Tagged


Versions (?)

Change Div Positioning to Fixed at a Specific Scroll Point - Some code from mjnestor - Forrst


 / Published in: JavaScript
 

  1. $(window).scroll(function(){
  2.     if  ($(window).scrollTop() >= 229){ //looking for the window to scroll to 229px in this example
  3.          $('#navigation_table').css({position:'fixed',top:0,left:'50%',margin:'0 0 0 -487.5px'});
  4.     } else {
  5.          $('#navigation_table').css({position:'relative'});
  6.         }
  7. });

Report this snippet  

You need to login to post a comment.