Pen Settings

HTML

CSS

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.

+ 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

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.

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

              
                <div class="page">
	
    	<nav class="panel">
    		<ul>
    			<li>
        			<div class="openSubPanel">Animals</div>
        			<ul class="subPanel">
            			<li class="heading">Animals</li>
                        <li>Dog</li>
                        <li>Cat</li>
                        <li>Rabbit</li>
                        <li>Horse</li>
                        <li>Donkey</li>
                        <li class="closeSubPanel">Back</li>
        			</ul>
    			</li>
                <li>
                    <div class="openSubPanel">Cars</div>
                    <ul class="subPanel">
                        <li class="heading">Cars</li>
                        <li>Ford</li>
                        <li>Renault</a></li>
                        <li>Kia</li>
                        <li>Dodge</li>
                        <li class="closeSubPanel">Back</li>
                    </ul>
                </li>
                <li>
                    <div class="openSubPanel">Colours</div>
                    <ul class="subPanel">
                        <li class="heading">Colours</li>
                        <li>Blue</li>
                        <li>Red</li>
                        <li>Green</li>
                        <li class="closeSubPanel">Back</li>
                    </ul>
    			</li>
  				<li class="closePanel">Close</li>
			</ul>
		</nav>

    <div class="wrapper">
    	<div class="menuTrigger">MENU</div>
    	<div class="container">
      		<h1>Off-canvas Multi-level Push Menu with CSS Transitions V0.9</h1>
          <p><span>Lightweight Off-canvas Multi-level menu with CSS transitions.</span> Space saving and responsive. Inspired by codrops multi-level push menu.</p>
          <p>Stripped back to basics, using jQuery to track panel states. Compatible (tested) with ie9+ (no slide animation in v9), modern browsers, android 2.3+, iphone 3+ & windows phone 8.</p>
          <p class="box">This demo was put together extremely quickly, so it's just pretty much a starting point. You could expand however you wanted really... use translate3D for better mobile performance, offset panels, add a fallback for older browser, add touch support, use checkbox hack for pure CSS implementation etc.</p> 
        	<p>Tootsie roll bear claw applicake pudding. Bonbon cheesecake dragée cookie tiramisu carrot cake marzipan. Powder jujubes chupa chups macaroon tiramisu sesame snaps jelly marshmallow. Chocolate cake unerdwear.com halvah cotton candy sesame snaps gingerbread cotton candy sweet roll pie.</p> 
          <p>Chupa chups gummies tart. Chocolate bar ice cream jujubes pie caramels bonbon candy dragée jelly. Toffee candy gummies dragée marshmallow. Sweet roll bonbon tootsie roll marzipan lollipop cupcake lemon drops danish. Chocolate bar lemon drops icing. Pastry soufflé wafer. Cupcake cookie donut pie tart cheesecake cookie applicake. Wafer liquorice unerdwear.com fruitcake cookie applicake gummi bears jujubes wafer. Halvah brownie pie chocolate cake fruitcake.</p>
          <p>Wafer liquorice chocolate bar chocolate bar lemon drops. Jelly-o chupa chups lollipop wafer brownie. Chocolate chocolate bar ice cream candy jujubes. Biscuit candy pudding pastry. Icing cheesecake cupcake sesame snaps jelly beans macaroon marzipan. Lemon drops bear claw tart pastry dragée liquorice. Gummi bears caramels chocolate cake pudding powder bear claw topping brownie.</p>
          <p>Marzipan sweet apple pie lollipop jelly beans candy canes chocolate cake sweet. Croissant sweet roll croissant bonbon pie. Macaroon chupa chups muffin unerdwear.com. Liquorice sweet jelly jujubes. Apple pie marshmallow croissant applicake carrot cake apple pie candy canes cheesecake danish. Chupa chups marshmallow carrot cake tiramisu chocolate sesame snaps lemon drops sweet roll. Pudding carrot cake danish tart. Sweet bonbon bonbon tart ice cream chocolate bar. Apple pie muffin jelly-o dragée powder.</p>
      	</div>
    </div>
</div>

              
            
!

CSS

              
                body{
				font:16px/24px Arial, Helvetica, sans-serif;
				}
				
				.page{
					overflow-x:hidden; 
					position:relative; 
					}
				
				.wrapper{
					position:relative;
					top:0;
					-webkit-transition: ease 0.5s;
					-moz-transition: ease 0.5s;
					-o-transition: ease 0.5s;
					transition: ease 0.5s;
					}
			
					.wrapper.pushed{
						-webkit-transform: translateX(-200px);
						-moz-transform: translateX(-200px);
						-ms-transform: translateX(-200px);
						-o-transform: translateX(-200px);
						transform: translateX(-200px);
						}
					
					.menuTrigger {
						position: absolute;
						right: 20px;
						top: 20px;
						padding: 10px 10px;
						background: #F15F48;
						cursor: pointer;
               color:#fff;
               font-weight:bold;
						}	
			
			.container{
				max-width:960px;
				padding:30px;
				margin:0 auto;
				}
				
				.container h1{
					margin-top:20px;
					font-size:24px;
					font-weight:bold;
					}	
				
				.container p{
					margin-top:20px;
					}

          .container p.box{
            background-color:#00B4AB;
            padding:10px;
				  color:#fff;
            font-weight:bold;
					}

          .container p span{
					font-weight:bold;
					}
					
			.panel, .subPanel {
			  width: 200px;
			  background:#F8F7F2;
			  position: absolute;
			  height:100%;
			  top: 0;
			  bottom: 0;
			  right: -200px;
			  -webkit-transition: ease 0.5s;
			  -moz-transition: ease 0.5s;
			  -o-transition: ease 0.5s;
			  transition: ease 0.5s;
			  overflow:hidden;
			}
			
				.panel{
					z-index:10;
					border-left:1px solid #F2F0E8;
					}
				
					.panel ul li{
						width: 180px;
						padding:10px;
						border-bottom: 1px solid #F2F0E8;
						color:#F15F48;
						cursor: pointer;
						}
					
					.panel ul li:hover {
						background: #F15F48;
						color: #fff;
						}
						
						.panel ul li ul li{
							color:#00B4AB;
							}
						
						.panel ul li ul li:hover{
							background:#00B4AB;
							color:#fff;
							}
					
			
					.panel.isOpen, .subPanel.isOpen {
						-webkit-transform: translateX(-200px);
						-moz-transform: translateX(-200px);
						-ms-transform: translateX(-200px);
						-o-transform: translateX(-200px);
						transform: translateX(-200px);
						}
					
				.subPanel{
					z-index:20;
					}
			
				.subPanel .heading {
		  		background: #F15F48;
		  		color: #fff;
				  font-weight:bold;
					}
		
		.closeSubPanel, .closePanel, .openSubPanel {
		  cursor: pointer;
		}
              
            
!

JS

              
                     $('.menuTrigger').click( function () {
    	  $('.panel').toggleClass('isOpen');
			 $('.wrapper').toggleClass('pushed');
		});

		$('.openSubPanel').click( function() {
    		$(this).next('.subPanel').addClass('isOpen');	
		});

		$('.closeSubPanel').click( function() {
    		$('.subPanel').removeClass('isOpen');
		});

		$('.closePanel').click( function() {
   	    $('.panel').removeClass('isOpen');
			  $('.wrapper').removeClass('pushed');
		});
              
            
!
999px

Console