function adjustFixedColumns()

in src/assets/js/main.js [42:63]


  function adjustFixedColumns() {
    // only change values if the fixed col is visible
    if ($(fixedColumnsSelector).css('display') == 'none') {
      return;
    }

    var headerHeight = $(headerSelector).outerHeight();
    var bannerHeight = $(bannerSelector).outerHeight();
    var bannerOffset = $(bannerSelector).offset().top;
    var bannerPosition = bannerOffset - $(window).scrollTop();
    var bannerVisibleHeight = Math.max(bannerHeight - (headerHeight - bannerPosition), 0);
    var topOffset = headerHeight + bannerVisibleHeight;

    var footerOffset = $(footerSelector).offset().top;
    var footerPosition = footerOffset - $(window).scrollTop();
    var footerVisibleHeight = $(window).height() - footerPosition;

    var fixedColumnsMaxHeight = $(window).height() - topOffset - footerVisibleHeight;

    $(fixedColumnsSelector).css('max-height', fixedColumnsMaxHeight);
    $(fixedColumnsSelector).css('top', topOffset);
  }