I'm trying to use the affix function to attach a heading to the top of the screen, but snap it to only part of the page. It should disconnect (and scroll up along with the content) when the user scrolls past a specific point.
I am using the script from this jsfiddle .
What I'm trying to do now is this:
$('#nav-wrapper').height($("#nav").height()); $('#nav').affix({ offset: $('#nav').position() }); $('#nav').detached({ offset: $('#bottom').position() });
With the .detached class:
.detached { position: static; }
Can't make it work. Any suggestions?
source share