LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

CSS
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
#mobile-nav {
  font-family: "Open Sans", Arial;
  text-transform: initial;
  letter-spacing: 1px;
  font-weight: 400;
}

.hovered {
  background-color: #000 !important;
  color: #fff !important;
  -moz-transition: background-color 0.2s !important 0s;
  -o-transition: background-color 0.2s !important 0s;
  -webkit-transition: background-color 0.2s !important;
  -webkit-transition-delay: 0s;
  transition: background-color 0.2s !important 0s;
}
.hovered::after {
  border-color: transparent transparent #666 transparent !important;
  -moz-transform: rotate(180deg) !important;
  -ms-transform: rotate(180deg) !important;
  -webkit-transform: rotate(180deg) !important;
  transform: rotate(180deg) !important;
}

.closed ul {
  box-shadow: none !important;
  margin-top: 0px !important;
}
.closed ul li {
  margin-top: -40px !important;
  height: 0px !important;
}

#mobile-nav > ul {
  float: left;
  list-style: none;
  line-height: 1.3;
}
#mobile-nav > ul .parent > a::after {
  position: relative;
  display: inline-block;
  content: "";
  width: 0;
  height: 0;
  top: -2px;
  margin: 0 8px 0 8px;
  border-style: solid;
  border-width: 0 4px 4px 4px;
  border-color: transparent transparent #000 transparent;
  color: black;
  -moz-transform: rotate(0deg);
  -ms-transform: rotate(0deg);
  -webkit-transform: rotate(0deg);
  transform: rotate(0deg);
  -moz-transition: -moz-transform 0.4s ease-out 0.2s, border-color 0.4s ease-out 0s;
  -o-transition: -o-transform 0.4s ease-out 0.2s, border-color 0.4s ease-out 0s;
  -webkit-transition: -webkit-transform 0.4s ease-out, border-color 0.4s ease-out;
  -webkit-transition-delay: 0.2s, 0s;
  transition: transform 0.4s ease-out 0.2s, border-color 0.4s ease-out 0s;
}
#mobile-nav > ul > li {
  float: left;
}
#mobile-nav > ul > li:first-child > a {
  -moz-border-radius-topleft: 4px;
  -webkit-border-top-left-radius: 4px;
  border-top-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
  -webkit-border-bottom-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border: none;
}
#mobile-nav > ul > li:last-child {
  width: 111.36px;
}
#mobile-nav > ul > li:last-child > a {
  -moz-border-radius-topright: 4px;
  -webkit-border-top-right-radius: 4px;
  border-top-right-radius: 4px;
  -moz-border-radius-bottomright: 4px;
  -webkit-border-bottom-right-radius: 4px;
  border-bottom-right-radius: 4px;
}
#mobile-nav > ul > li:not(.parent) > a {
  padding-right: 16px;
}
#mobile-nav > ul > li a {
  background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjE3NSIvPjxzdG9wIG9mZnNldD0iMzAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMDg3NSIvPjxzdG9wIG9mZnNldD0iNjAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuMDg3NSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjE3NSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
  background-size: 100%;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.175)), color-stop(30%, rgba(255, 255, 255, 0.0875)), color-stop(60%, rgba(0, 0, 0, 0.0875)), color-stop(100%, rgba(0, 0, 0, 0.175)));
  background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0.175), rgba(255, 255, 255, 0.0875) 30%, rgba(0, 0, 0, 0.0875) 60%, rgba(0, 0, 0, 0.175));
  background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0.175), rgba(255, 255, 255, 0.0875) 30%, rgba(0, 0, 0, 0.0875) 60%, rgba(0, 0, 0, 0.175));
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.175), rgba(255, 255, 255, 0.0875) 30%, rgba(0, 0, 0, 0.0875) 60%, rgba(0, 0, 0, 0.175));
  -moz-transition: background-color 0.2s ease-out 0.2s, color 0.2s ease-out 0s;
  -o-transition: background-color 0.2s ease-out 0.2s, color 0.2s ease-out 0s;
  -webkit-transition: background-color 0.2s ease-out, color 0.2s ease-out;
  -webkit-transition-delay: 0.2s, 0s;
  transition: background-color 0.2s ease-out 0.2s, color 0.2s ease-out 0s;
  padding: 5px 0 5px 5.33333px;
  background-color: #666;
  border-left: 1px solid #000;
  text-decoration: none;
  color: #fff;
}
#mobile-nav .dropdown {
  list-style: none;
  margin-top: 4px;
  position: absolute;
  width: 180px;
  padding: 0;
  overflow: hidden;
  /*@include border-radius(0px 0px $border-radius $border-radius);*/
  -moz-transition: margin-top 1s;
  -o-transition: margin-top 1s;
  -webkit-transition: margin-top 1s;
  transition: margin-top 1s;
  animation: margin-push 1s infinite;
  -webkit-animation: margin-push 1s infinite;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -moz-box-shadow: 0px 15px 20px 0px rgba(50, 50, 50, 0.4), 12px 15px 15px -4px rgba(50, 50, 50, 0.4), -12px 15px 15px -4px rgba(50, 50, 50, 0.4);
  -webkit-box-shadow: 0px 15px 20px 0px rgba(50, 50, 50, 0.4), 12px 15px 15px -4px rgba(50, 50, 50, 0.4), -12px 15px 15px -4px rgba(50, 50, 50, 0.4);
  box-shadow: 0px 15px 20px 0px rgba(50, 50, 50, 0.4), 12px 15px 15px -4px rgba(50, 50, 50, 0.4), -12px 15px 15px -4px rgba(50, 50, 50, 0.4);
}
#mobile-nav .dropdown::before {
  position: absolute;
  left: 50%;
  margin: 1px 0 0 -50px;
  content: "";
  width: 0px;
  height: 0px;
  border-style: solid;
  border-width: 0 10px 10px 10px;
  border-color: transparent transparent #666 transparent;
}
#mobile-nav .dropdown li {
  width: 100%;
  height: 30px;
  vertical-align: top;
  overflow: hidden;
  cursor: pointer;
  -moz-transition: margin-top 0.5s, height 0.5s;
  -o-transition: margin-top 0.5s, height 0.5s;
  -webkit-transition: margin-top 0.5s, height 0.5s;
  transition: margin-top 0.5s, height 0.5s;
  animation: margin-height-push 0.5s infinite;
  -webkit-animation: margin-height-push 0.5s infinite;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
#mobile-nav .dropdown li:first-child {
  margin-top: 10px;
}
#mobile-nav .dropdown li:first-child > a {
  border: none;
}
#mobile-nav .dropdown li:last-child {
  border-bottom: 1px solid #666;
}
#mobile-nav .dropdown li a {
  background: #666;
  color: #fff;
  position: absolute;
  display: block;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-left: 4px;
  padding-right: 0;
  width: 176px;
  border-top: 1px solid #cccccc;
  border-left: none;
}
#mobile-nav .dropdown li a:hover {
  -moz-box-shadow: inset 0 0 10px white;
  -webkit-box-shadow: inset 0 0 10px white;
  box-shadow: inset 0 0 10px white;
}

/*#menu-toggle {
    display: none;
    font-size: 2em;
    width: 100%;
    @include filter-gradient(#d34144, #b50c0f, vertical);
    @include background-image(linear-gradient(top,  #d34144 0%,#d34144 18%,#b50c0f 100%));
}*/
/*@media all and (max-width: 959px) {
    #mobile-nav > ul {
        margin: 13px 20px 0 0;
        right: 0;
        background: #333;
        height: inherit;
        padding: 0;
        position: relative;
        z-index: 50;
        > li:first-child a, li:last-child a {
            @include border-radius(0px);
        }
    }
    #mobile-nav::before {
            content: '';
            width: 100%;
            padding: 21px 0;
            background-color: #333;
            position: absolute;
            left: 0;
            right: 0;
            z-index: 1;
        }
}*/
/*@media all and (max-width: 600px) {
    .dropdown {
      position: relative;
      left: 0;
      z-index: auto;
      margin: 0;
      display: block;
      width: 100%;
      border-radius: 0;
      &::before {
        display: none;
      }
      li {
        width: 90%;
        height: 48px;
        float: right;
        &:first-child {
            margin-top: 0;
        }
      }
    }
    #menu-toggle {
        display: block;
        padding: .5em 0;
        text-indent: 20px;
        text-decoration: none;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -o-user-select: none;
    }
    #mobile-nav {
        &::before {
            display: none;
            content: '';
        }
        > ul {
            display: none;
            float: initial;
            margin: 0 !important;
            > li {
                width: 100%;
                float: initial;
                &:first-child > a {
                    border-left: none;
                }
                > a {
                    border-top: 1px solid $separator;
                }
                a {
                    padding: 0;
                    width: 100%;
                    line-height: 3;
                    display: block;
                    text-indent: 20px;
                    &:hover {
                        text-shadow: none;
                        background: initial;
                        color: #fff;
                    }
                }
            }
        }
    }
}*/
JS
// Google Web Font API
WebFontConfig = {
  google: { families: [ 'Open+Sans::latin' ] }
};
(function() {
  var wf = document.createElement('script');
  wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
    '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  wf.type = 'text/javascript';
  wf.async = 'true';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(wf, s);
})();

// Custom jQuery
var parent = $("#mobile-nav").children('ul').children('li');

function postloadFunc() {
  $(parent).find('ul').addClass('dropdown');
  $('.dropdown').parent('li').addClass('parent');
}

postloadFunc();

$(parent).on('mouseenter', function (event) {
  event.preventDefault();
  $(this).removeClass('closed');
  $(this).children('a').addClass('hovered');
});

$(parent).on('mouseleave', function(event) {
  event.preventDefault();
  $(this).addClass('closed');
 $(parent).children('a').removeClass('hovered');
});
Host Instantly Drag and Drop Website Builder

 

Description

PLAY WITH THE VARIABLES! Built in semantic HTML5 (HAML) and uses SCSS, and JS / jQuery. Uses CSS3 transitions, animations, and media queries. It is a so called dynamic 'smart component'. Leveraging SASS mixins, variables, and math, this nav is completely adjustable & reusable.
Term
Mon, 11/27/2017 - 22:01

Related Codes

Pen ID
Pen ID
Pen ID