LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

CSS
* {
  font-family: 'helvetica nue', sans-serif;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
  /* For some Androids */
}

.top-animate {
  background: #fff !important;
  top: 13px !important;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
}

.mid-animate {
  opacity: 0;
}

.bottom-animate {
  background: #fff !important;
  top: 13px !important;
  -webkit-transform: rotate(-225deg);
  transform: rotate(-225deg);
}

.top-menu {
  top: 5px;
  width: 25px;
  height: 2px;
  border-radius: 10px;
  background-color: #F9A530;
}

.mid-menu {
  top: 13px;
  width: 25px;
  height: 2px;
  border-radius: 10px;
  background-color: #F9A530;
}

.bottom-menu {
  top: 21px;
  width: 25px;
  height: 2px;
  border-radius: 10px;
  background-color: #F9A530;
}

.menui {
  background: orange;
  transition: 0.6s ease;
  transition-timing-function: cubic-bezier(.75, 0, .29, 1.01);
  margin-top: 10px;
  position: absolute;
}

.icon {
  z-index: 999;
  position: fixed;
  display: block;
  padding: 9px;
  height: 32px;
  width: 32px;
  margin: 0px;
  top: 0;
  left: 0;
}

.mobilenav {
  font-family: inherit;
  top: 0;
  left: 0;
  z-index: 999;
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  background: orange;
}

.mobilenav li {
  list-style-type: none;
  text-align: center;
  padding: 10px;
}

.mobilenav li a {
  font-size: 150%;
  color: #fff;
  text-decoration: none;
  font-weight: 300;
  width: 100%;
}

.mobilenav li:first-child {
  margin-top: 60px;
}
JS
// HAMBURGLERv2

function togglescroll() {
  $('body').on('touchstart', function(e) {
    if ($('body').hasClass('noscroll')) {
      e.preventDefault();
    }
  });
}

$(document).ready(function() {
  togglescroll()
  $(".icon").click(function() {
    $(".mobilenav").fadeToggle(500);
    $(".top-menu").toggleClass("top-animate");
    $("body").toggleClass("noscroll");
    $(".mid-menu").toggleClass("mid-animate");
    $(".bottom-menu").toggleClass("bottom-animate");
  });
});

// PUSH ESC KEY TO EXIT

$(document).keydown(function(e) {
  if (e.keyCode == 27) {
    $(".mobilenav").fadeOut(500);
    $(".top-menu").removeClass("top-animate");
    $("body").removeClass("noscroll");
    $(".mid-menu").removeClass("mid-animate");
    $(".bottom-menu").removeClass("bottom-animate");
  }
});
Term
Wed, 11/29/2017 - 09:31

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv