summaryrefslogtreecommitdiff
path: root/static/js/main.js
blob: 001bccd7a78498c20e09af446110ba2804614e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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");
      }
  });
}

if(/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream){
    var elements = document.getElementsByTagName('a');
    for(var i = 0; i < elements.length; i++){
        elements[i].addEventListener('touchend',function(){});
    }
}