document.addEventListener("DOMContentLoaded", function(){
  window.addEventListener('scroll', function() {
      if (window.scrollY > 6) {
        document.getElementById('nav').classList.add('fixed-top');
        // add padding top to show content behind navbar
       /* navbar_height = document.querySelector('.nav-section').offsetHeight;
        document.body.style.paddingTop = navbar_height + 'px';*/
      } else {
        document.getElementById('nav').classList.remove('fixed-top');
         // remove padding top from body
        document.body.style.paddingTop = '';
        
      } 
  });

 
  

}); 





