Исчезает навигационное меню при нажатие на гамбургер в адаптивной версии

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/normalize.css">
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <title>jndsff</title>
    <meta name="description" content="jndsff">
</head>
<body>
<nav>
    <ul class="nav-menu" id="myTopnav">
      <li><a href="#">jndsff</a>
        <ul>
          <li><a href="#">jndsff</a></li>
          <li><a href="#">jndsff</a></li>
          <li><a href="#">jndsff</a></li>
        </ul>
      </li>
      <li><a href="#">jndsff</a>
        <ul>
          <li><a href="#">jndsff</a></li>
          <li><a href="#">jndsff</a></li>
        </ul>
      </li>
      <li><a href="#">jndsff</a>
        <ul>
          <li><a href="#">jndsff</a></li>
          <li><a href="#">jndsff</a></li>
          <li><a href="#">jndsff</a></li>
        </ul>
      </li>
      <li><a href="#">jndsff</a></li>
      <div class="menuToggle icon">
        <div class="hamburger"></div>
      </div>
    </ul>
  </nav>

@charset "UTF-8";
/* Всплывающее меню */
.nav-menu {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: #b0c3eb;
  padding: 10px 10px;
}
 
/* Блоки для текста меню */
.nav-menu li {
  display: block;
  position: relative;
  width: 100%;
  padding: 12px;
  font-size: 1em;
  text-shadow: 1px 1px 0 dark;
}
 
/* Формат самого текста */
.nav-menu li a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: #000;
  -webkit-transition: all 0.2s linear;
  transition: all 0.2s linear;
}
 
/* Смена цвета текста нав-меню */
.nav-menu li a:hover {
  color: #897322;
  border-bottom: solid 1px transparent;
}
 
/* Блок для выпадающего меню */
.nav-menu ul {
  position: absolute;
  width: 130px;
  background: #fff;
  display: none;
  margin: 0;
  padding: 7px 0;
  list-style: none;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
          box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
 
/* Настройки внутри выпадающего меню */
.nav-menu ul:after {
  content: "";
  width: 0;
  height: 0;
  position: absolute;
  bottom: 100%;
  left: 8px;
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: #fff transparent;
}
 
.nav-menu ul:before {
  content: "";
  width: 0;
  height: 0;
  position: absolute;
  bottom: 100%;
  left: 4px;
  border-width: 0 10px 10px 10px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.1) transparent;
}
 
.nav-menu ul li {
  display: block;
  width: 100%;
  font-size: 0.9em;
  text-shadow: 1px 1px 0 #fff;
}
 
.nav-menu ul li a {
  display: block;
  width: 100%;
  padding: 6px 7px;
  line-height: 1.4em;
  -webkit-transition: all 0.2s linear;
  transition: all 0.2s linear;
}
 
/* Настройка смены цветов выпатающего меню */
.nav-menu ul li a:hover {
  background: #e9edf3;
}
 
.menuToggle {
  padding: 10px;
  color: #fff;
  cursor: pointer;
  display: none;
}
 
.icon {
  width: 20px;
  height: 18px;
  cursor: pointer;
  margin: 0 8px 0 5px;
}
 
.hamburger {
  width: 30px;
  height: 1px;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  background: #605ecc;
  -webkit-transition: 0.5s;
  transition: 0.5s;
  display: inline-block;
  margin: 0 10px;
}
 
.hamburger:before,
.hamburger:after {
  content: "";
  width: 30px;
  height: 2px;
  position: absolute;
  background: #9982b9;
  -webkit-transition: 0.5s;
  transition: 0.5s;
}
 
.hamburger:before {
  top: -10px;
}
 
.hamburger:after {
  top: 10px;
}
 
.icon.active .hamburger {
  background: rgba(0, 0, 0, 0);
}
 
.icon.active .hamburger:before {
  top: 0;
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
}
 
.icon.active .hamburger:after {
  top: 0;
  -webkit-transform: rotate(135deg);
          transform: rotate(135deg);
}
 
@media (max-width: 767px) {
  .menuToggle {
    float: right;
    display: block;
  }
  .nav-menu li:not(:first-child) {
    display: none;
  }
  .nav-menu li a:first-child {
    text-align: left;
  }
}
 
@media screen and (max-width: 767px) {
  .nav-menu.active {
    display: block;
    float: right;
    top: 0;
    right: 0;
    height: 100vh;
    background: #cda9e2;
    padding: 10px 10px;
  }
  .nav-menu.active li {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 1em;
    text-shadow: 1px 1px 0 dark;
  }
  .nav-menu.active li a {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #1642a1;
    -webkit-transition: all 0.2s linear;
    transition: all 0.2s linear;
  }
  .nav-menu.active li:hover > a {
    color: #7180a0;
    background: #d9e2ee;
  }
}

// Функция всплывающего меню
$(document).ready(function(){
  $('a').on('click', function(e){
    e.preventDefault();
  });
    
  $('.nav-menu li').hover(function () {
     clearTimeout($.data(this,'timer'));
     $('ul',this).stop(true,true).slideDown(20);
  }, function () {
    $.data(this,'timer', setTimeout($.proxy(function() {
      $('ul',this).stop(true,true).slideUp(20);
    }, this), 100));
  });

});

// Функция активации гамбургера

  $(".menuToggle").click(function() {
    $(this).toggleClass('active');
    $('.nav-menu').toggleClass('active');
    $('.nav-menu').Toggle(300, function(){
      if($(this).css('display') === "none"){
        $(this).removeAttr('style');
      }
    });
  });

Ответы (0 шт):