jqueryスクロール位置でスタイルを変更 fixed

  var scrollBottom;
  var footerTop = $("#footer").offset().top;
  var nav = $(".campaignBanner a");

  function getScrollTop(){
    scrollBottom = $(window).scrollTop() + $(window).height();
    if(scrollBottom >= footerTop){
      nav.removeClass("fixed");
      nav.addClass("absolute");
    }else{
      nav.addClass("fixed");
      nav.removeClass("absolute");
    }
  }
  $(window).on("load scroll resize", getScrollTop);