I'm trying to add a floating navigation to the side bar. I have jquery floating the nav to the top after you begin scrolling. It works fine at the top, but once you reach the bottom the footer hides the navigation. The navigation needs to scroll up once it reaches a certain point. Any solutions?
<script type="text/javascript">
$(document).ready(function () {
var top = $('#floatingNav').offset().top - parseFloat($('#floatingNav').css('marginTop').replace(/auto/, 0));
$(window).scroll(function (event) {
var y = $(this).scrollTop();
if (y >= top) {
$('#floatingNav').addClass('fixed');
} else {
$('#floatingNav').removeClass('fixed');
}
});
});
</script>
Here's the example: http://psidev.inhousewp.synergydatasystems.com/products/