I've been looking all over on how to fix a div when scrolling past 100% and then for it to sit again when below 100%.
I have been using this jsfiddle to work when i want to sit at a certain pixel height.
Any help would be greatly appreciated.
Alternatively, having the div fix when another div is on visible may work just as well.
Thanks in advance.
Here is the code for jsfiddle.
function fixDiv() {
var $cache = $('#getFixed');
if ($(window).scrollTop() > 100)
$cache.css({'position': 'fixed', 'top': '10px'});
else
$cache.css({'position': 'relative', 'top': 'auto'});
}
$(window).scroll(fixDiv);
fixDiv();