global.js 440 B

12345678910111213141516171819202122
  1. jQuery(function( $ ){
  2. // Sticky Announcement Bar
  3. var headerHeight = $('.site-header').innerHeight();
  4. var beforeheaderHeight = $('.before-header').outerHeight();
  5. var abovenavHeight = headerHeight + beforeheaderHeight - 1;
  6. $(window).scroll(function(){
  7. if ($(document).scrollTop() > abovenavHeight){
  8. $('.announcement-widget').addClass('fixed');
  9. } else {
  10. $('.announcement-widget').removeClass('fixed');
  11. }
  12. });
  13. });