Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <nav id="menu">
    <ul class="mobile-nav" id="mobile">
        <li class="menu-item menu-item-has-children">
            <a href="#">Visit</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">What&#8217;s On</a>
                </li>

                <li class="menu-item">
                    <a href="#">Hours &#038; Rates</a>
                </li>

                <li class="menu-item">
                    <a href="#">Groups</a>
                </li>

                <li class="menu-item">
                    <a href="#">Families &#038; Kids</a>
                </li>

                <li class="menu-item">
                    <a href="#">Our Neighbourhood</a>
                </li>

                <li class="menu-item">
                    <a href="#">Getting Here</a>
                </li>

                <li class="menu-item">
                    <a href="#">Visitor Information</a>
                </li>
            </ul>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">Experience</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">Exhibits</a>
                </li>

                <li class="menu-item">
                    <a href="#">Events</a>
                </li>

                <li class="menu-item">
                    <a href="#">Collections</a>
                </li>
            </ul>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">Learn</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">School Programs</a>
                </li>

                <li class="menu-item">
                    <a href="#">Youth Programs</a>
                </li>

                <li class="menu-item">
                    <a href="#">Adult Programs</a>
                </li>

                <li class="menu-item">
                    <a href="#">Resources</a>
                </li>
            </ul>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">Join &#038; Give</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">Donate</a>
                </li>

                <li class="menu-item">
                    <a href="#">Become a Member</a>
                </li>

                <li class="menu-item">
                    <a href="#">Volunteer</a>
                </li>

                <li class="menu-item">
                    <a href="#">Sponsors</a>
                </li>
            </ul>
        </li>

        <li class="menu-item">
            <a href="#">Shop</a>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">About</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">Society</a>
                </li>

                <li class="menu-item">
                    <a href="#">People</a>
                </li>

                <li class="menu-item">
                    <a href="#">Careers</a>
                </li>

                <li class="menu-item">
                    <a href="#">Press</a>
                </li>

                <li class="menu-item">
                    <a href="#">Media</a>
                </li>
            </ul>
        </li>

        <li class="menu-item">
            <a href="#">Blog</a>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">Rentals</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">Weddings &#038; Events</a>
                </li>

                <li class="menu-item">
                    <a href="#">Film &#038; TV</a>
                </li>

                <li class="menu-item">
                    <a href="f#">FAQ&#8217;s &#038; Policies</a>
                </li>
            </ul>
        </li>

        <li class="menu-item menu-item-has-children">
            <a href="#">Farmers Market</a>

            <ul class="sub-menu">
                <li class="menu-item">
                    <a href="#">Become a Vendor</a>
                </li>

                <li class="menu-item">
                    <a href="#">Market</a>
                </li>

                <li class="menu-item">
                    <a href="#">Our Vendors</a>
                </li>
            </ul>
        </li>

        <li class="menu-item">
            <a href="#">Contact</a>
        </li>
    </ul>
</nav><!-- nav -->

<div class="container">
    <a class="menu-btn menu-link" href="#menu" id="nav-icon">
      <span></span>
      <span></span> 
      <span></span>
    </a>
</div>
              
            
!

CSS

              
                html, body {
	padding: 0;
	margin: 0;
}

html, body {
	height: 100%;
}

body {
  font-family: 'PT Sans';
	background-color: #FFFFF4;
	color: #000;
	min-height: 100%;
	position: relative;
	-webkit-text-size-adjust: none;
  overflow-x: hidden;
}

body * {
	text-shadow: none;
}

/* Menu Styles */

#menu {
   position: fixed;
   top: 0;
   bottom: 0;
   width: 260px;
   left: -260px;
   height: 100%;
   -webkit-transform: translate(0px, 0px);
  -moz-transform: translate(0px, 0px);
  -o-transform: translate(0px, 0px);
  -ms-transform: translate(0px, 0px);
  transform: translate(0px, 0px);
  -webkit-transition: 0.30s ease;
  -moz-transition: 0.30s ease;
  -o-transition: 0.30s ease;
  transition: 0.30s ease;
}

 #menu.active {
  -webkit-transform: translate(260px, 0px);
  -moz-transform: translate(260px, 0px);
  -o-transform: translate(260px, 0px);
  -ms-transform: translate(260px, 0px);
  transform: translate(260px, 0px);
}

.container {
  width: 100%;
   -webkit-transform: translate(0px, 0px);
   -moz-transform: translate(0px, 0px);
   -o-transform: translate(0px, 0px);
   -ms-transform: translate(0px, 0px);
   transform: translate(0px, 0px);
   -webkit-transition: 0.30s ease;
   -moz-transition: 0.30s ease;
   -o-transition: 0.30s ease;
   transition: 0.30s ease;  
}

.container.active {
  -webkit-transform: translate(260px, 0px);
  -moz-transform: translate(260px, 0px);
  -o-transform: translate(260px, 0px);
  -ms-transform: translate(260px, 0px);
  transform: translate(260px, 0px);
}

/* List styling... not necessary for demo */

ul, ol {
  list-style: none;
  text-decoration: none;
  margin: 0;
  padding: 0;
}

#menu ul.mobile-nav > li > a {
  background: #4F7389;
  color: #FFFFFF;
  font-size: 24px;
}

.mobile-nav ul.sub-menu {
  text-transform: uppercase;
}

.mobile-nav a {
  display: block;
  color: #777779;
  padding: 15px 30px;
  border-top: 1px solid #4F7389;
  text-decoration: none;
}

.mobile-nav a:hover{
    background: #4F7389;
    color: #FFFFFF;
}

/* Nav Icon */

#nav-icon {
  width: 30px;
  height: 20px;
  display: block;
  position: absolute;
  top: 40px;
  left: 20px;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .5s ease-in-out;
  -moz-transition: .5s ease-in-out;
  -o-transition: .5s ease-in-out;
  transition: .5s ease-in-out;
  cursor: pointer;
  display: block;
}

#nav-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: #000;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .25s ease-in-out;
  -moz-transition: .25s ease-in-out;
  -o-transition: .25s ease-in-out;
  transition: .25s ease-in-out;
}

#nav-icon {
  text-decoration: none;
  color: #000;
  font-family: 'PT Sans';
}

#nav-icon:after {
  content: "Menu";
  margin-left: 40px;
  font-size: 24px;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 0.95em;
}

#nav-icon span:nth-child(1) {
  top: 0px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

#nav-icon span:nth-child(2) {
  top: 8px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

#nav-icon span:nth-child(3) {
  top: 16px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

/* Icon Animation */

.active #nav-icon span:nth-child(1) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
  top: -3px;
  left: 8px;
}

.active #nav-icon span:nth-child(2) {
  width: 0%;
  opacity: 0;
}

.active #nav-icon  span:nth-child(3) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  top: 19px;
  left: 8px;
}

#menu.active {
  overflow-y: scroll;
  overflow-x: hidden;
}
              
            
!

JS

              
                $(".menu-link").click(function(){
      $("#menu").toggleClass("active");
      $(".container").toggleClass("active");
});
              
            
!
999px

Console