cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <a class="mobile" href="#">&#9776;</a>
<nav>
  <ul>
    
    <li><a href="#">Link 1</a></li>
    <li>
        <a href="#">Link 2</a>
        <ul>
            <li><a href="#">Sublink 1</a></li>
            <li><a href="#">Sublink 2</a></li>
            <li><a href="#">Sublink 3</a></li>
            <li><a href="#">Sublink 4</a></li>
        </ul>
    </li>
    <li><a href="#">Link 3</a></li>
    <li><a href="#">Link 4</a>
    <ul>
            <li><a href="#">Sublink 1</a></li>
            <li><a href="#">Sublink 2</a></li>
            <li><a href="#">Sublink 3</a></li>
            <li><a href="#">Sublink 4</a></li>
        </ul></li>
    <li><a href="#">Link 5</a></li>
    <li><a href="#">Link 6</a></li>
  </ul>
  <div style="clear:both;"></div>
</nav>
            
          
!
            
              @import "compass/css3";

/*********************
VARIABLES
**********************/
$link-color:white;
$link-hover:#00aedb;
$link-vertical-padding:15px;      //Controls Menu top & bottom padding
$link-horizontal-padding:20px;    //Contols Menu left & right padding
$menu-background:#353535;        //Control Menu Color Scheme

/*********************
RESPONSIVE BREAKPOINT
**********************/
@mixin breakpoint($point) {
  @if $point == 715 {
    @media (max-width: 715px) { @content; }
  }
  @else if $point == another-break-point {
    @media (max-width: 0) { @content; }
  }
}

body {
  background:url(http://www.jasonkinney.me/images/navy_blue.png);
  overflow-x:hidden;
}

/*********************
NAVIGATION STYLES
**********************/
nav {
  width:100%;
  background: linear-gradient(to bottom, $menu-background 0%, darken($menu-background,7%) 100%);
  box-shadow:0px 2px 2px rgba(0,0,0,.35);
  
  @include breakpoint(715) {
    margin:65px 0 0 0;
    max-height:0;
    overflow:hidden;
    transition: all 0.5s ease;
    background:darken(#262626,5%);
  }
}

nav ul {
  margin:0;
  list-style:none;
  
   @include breakpoint(715) {
	    margin:0;
      padding:0;
	    box-shadow:0px 1px 3px rgba(0,0,0,.7);
	    z-index:15;
    } 
  
  li {
    float:left;
    position:relative;
    z-index:1;
    
    @include breakpoint(715) {
      float:none;
      position:relative;
      margin:0;
    }
    
    a {
      display:block;
      padding: $link-vertical-padding $link-horizontal-padding;
      text-align:center;
      color:$link-color;
      text-decoration:none;
      border-right:1px solid darken($menu-background,10%);
      text-shadow:2px 2px 2px rgba(0,0,0,.8);
      @include transition-duration(0.1s);
      
      &:hover {
        background:darken($menu-background,10%);
        color:$link-hover;
        @include transition-duration(0.2s);
      }

      @include breakpoint(715) {
      	display:table;
      	margin:0;
    	  padding:15px 2px;
      	color:white;
      	border-top:1px solid rgba(0,0,0,.15);
        box-shadow:inset 0px 1px 3px rgba(255,255,255,.03);
      	text-shadow:none;
      	width:100%;
      }
    }
    
    &:hover ul {
      opacity:1;
      max-height:1000px;
      @include transition-duration(0.3s);
      
      @include breakpoint(715) {
        max-height:0;
      } 
    }
    
    /******************
    SUBNAV
    ******************/
    
    ul {
      background:darken($menu-background,10%);
      list-style:none;
      padding:0;
      position:absolute;
      width:200px;
      max-height:0;
      z-index:0;
      opacity:0;
      overflow:hidden;
      font-size:.9em;
      box-shadow:0px 2px 2px rgba(0,0,0,.5);
      @include transition-duration(0.3s);
      
      @include breakpoint(715) {
        max-height:0;
        opacity:1;
        width:100%;
        position:relative;
        overflow:hidden;
        box-shadow:inset 0px 2px 2px rgba(0,0,0,.5);
        @include transition-duration(2s);
      }
      
      li {
        float:none;
        margin:0;

        @include breakpoint(715) {
          margin:0;
        }
        
        a {
          display:block;
          text-align:left;
          padding:$link-vertical-padding/1.5 $link-horizontal-padding/1.5;
          margin:0;
          border-right:none;
          border-top:1px solid darken($menu-background,12%);
          box-shadow:inset 0px 1px 3px rgba(255,255,255,.03);
          text-transform:none;
          text-shadow:none;
          @include transition-duration(0.2s);
          
          &:hover {
          	color:$link-hover;
            background:lighten($menu-background,5%);
            @include transition-duration(0.5s);
          }

          @include breakpoint(715) {
          	color:white;
          	padding-left:20px;
          	background:none;
          }
        }
      }
    }
  }
}


/***************************
MOBILE NAV STYLES
***************************/
.mobile {
  display:none;
  margin:0;
  padding:20px 15px;
  background: linear-gradient(to bottom, #353535 0%,#262626 100%);
  position:absolute;
  color:white;
  text-decoration:none;
  top:15px;
  right:15px;
  line-height:0;
  box-shadow:0px 2px 2px rgba(0,0,0,.35);
  
  @include breakpoint(715) {
    display:table;
  }
}

.active {
  max-height:9000px !important;
  @include transition-duration(1s);
 }

@include breakpoint(715) {
  .arrow {
    display:block;
    background:url(http://www.jasonkinney.me/images/arrow.png) no-repeat;
    float:right;
    height:30px;
    width:30px;
    position:absolute;
    right:25px;
    top:10px;
    @include transition-duration(0.3s);
  
    &:hover {
      cursor:pointer;
    }
  }

  .rotate {
	  @include transition-duration(0.3s);
	  -webkit-transform:rotate(-180deg);
      -moz-transform:rotate(-180deg);
       -o-transform:rotate(-180deg);
          transform:rotate(-180deg);
  }
}


            
          
!
            
              $(document).ready(function() {
  $('.mobile').click(function () {
	  $('nav').toggleClass('active'); 
   });
  
   $('nav ul li ul').each(function() {
    $(this).before('<span class=\"arrow\"></span>');
  });
  
  $('nav ul li').click(function() {
    $(this).children('ul').toggleClass('active');
     $(this).children('.arrow').toggleClass('rotate');
  });
});
            
          
!
999px
Loading ..................

Console