Conditional Fixed Positioning with jQuery

Many websites use CSS fixed positioning to pin elements to the top or bottom of a webpage so they never scroll out of view. This technique is commonly used for navigation elements on sites that require the user to scroll through many screenfuls of information on a single page.

I put together a demo that conditionally applies fixed positioning to a side navigation element when it scrolls to the top of the browser window.

Continue reading
  • page 1 of 1
Author's picture

Greg Jopa

Web developer and musician. Passionate about the open web.


Web Developer


Chicago, Illinois