summaryrefslogtreecommitdiff
path: root/static/js/main.js
blob: dc1425b6941141541498007ddad9713378c610a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function isMobile() {
   return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}

//if not a mobile device, then...
if (!isMobile()) {

  //resize menu to .fixedtheme styling on scroll
  $(document).on("scroll",function(){
      if($(document).scrollTop()>10){
          $("nav").addClass("fixedtheme");
          $("#header-container").addClass("fixedtheme");
      } else{
          $("nav").removeClass("fixedtheme");
          $("#header-container").removeClass("fixedtheme");
      }
  });
}