I couldn't find the JavaScript that's making it work, but it looks like it's adding a class to the postcomment div when the window's scrollTop is equal to or greater than the div's offset top. The class has a style declaration with position:fixed.

here is a quick and dirty way to do this (using div id="sidebar" as the example). Probably better to add/remove a class, but just so you can see what you might have to put in the class ...

$(document).ready(function() {
  var sbOffset = $('#sidebar').offset().top;
  $('#sidebar').css('top', '0')
  $(window).bind('scroll', function() {

$('#sidebar').css('position', sbOffset > $(window).scrollTop() ? 'relative': 'fixed');
  });
});


Keep in mind that this isn't going to work in IE6. For that, you'll have to resort to some other tomfoolery.

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Jul 17, 2008, at 3:19 PM, nbchip wrote:


How would i make Navigation layer fix it self at top of the window
after some point of scrolling, so its always visible.....
Like the right side menu at this link:
http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0002240

thx.

Reply via email to