导航栏

.navigation {
    position: fixed;
    bottom: 100px;
    right: 100px;
    z-index: 100;
}
.navigation {
    transition: bottom 2s;
    -webkit-transition: bottom 2s;
}

JQ代码

var nav = eval($('.navigation').offset().top - $(window).scrollTop());
$(window).on('scroll', function() {
    var navh = $('.navigation').height();
    var foot = parseInt($('.footer').offset().top - $(this).scrollTop() - navh);
    /*console.log(nav - foot);*/
    if(nav == foot || nav > foot) {
        $('.navigation').css({
            'position': 'fixed',
            'bottom': '400px'
        });
    } else {
        $('.navigation').css({
            'position': 'fixed',
            'bottom': '100px'
        });
    }
});

相关文章:

  • 2021-10-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2022-01-07
  • 2021-06-27
  • 2021-07-10
  • 2021-04-08
  • 2021-05-10
相关资源
相似解决方案