When using scrollToFixed, my goal is to make a footer stick to the bottom of the page until it reaches the actual footer and then stop. However, I'm encountering a bug where it scrolls past the footer and then snaps back to the top of the footer. Any insights on why this is happening? You can view the issue on the live site here:
jQuery('#scroller').scrollToFixed({
bottom: 0,
limit: function() {
var limit = 0;
if (jQuery(window).height() > jQuery('#page').height()) {
jQuery('#colophon').css({'position':'fixed','bottom':'0'});
jQuery('#scroller').css({'position':'fixed','bottom':'40px'});
} else {
jQuery('#colophon').css({'position':'static'});
limit = jQuery('#scroller').offset().top + 40;
}
return limit;
}
});