cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <ul class="menu">
        <li class="to-home"><a href="#">Home</a></li>
        <li><a href="#about">About cats</a></li>
        <li><a href="#gallery">Gallery</a></li>
        <li><a href="#links">Links</a></li>
        <li><a href="#contacts">Contacts</a></li>
    </ul>

    <div id="about" class="page">
        <div class="page-content">
            <h2>About cats</h2>

            <p>Cats are cute</p>
        </div>
    </div>

    <div id="gallery" class="page">
        <div class="page-content">
            <h2>Gallery</h2>

            <p>Gallery with cats</p>
        </div>
    </div>

    <div id="links" class="page">
        <div class="page-content">
            <h2>Links</h2>

            <p>Links to blogs with cats</p>
        </div>
    </div>

    <div id="contacts" class="page">
        <div class="page-content">
            <h2>Contacts</h2>

            <p>Some contact form</p>
        </div>
    </div>

            
          
!
            
              body,div,p {
	margin:0;
	padding:0;
	font-family:Helvetica,sans-serif;
	font-size:18px;
}


html {
	background:url("http://ivayloyovchev.com/pulsepro/data/img/gallery/wedding/IMG_3312.jpg") no-repeat center center fixed;
	-webkit-background-size:cover;
	-moz-background-size:cover;
	-o-background-size:cover;
	background-size:cover;
}

.menu {
	position:fixed;
	top:10%;
	left:-40px;
	z-index:100;
}

.menu li {
	list-style:none;
	display:block;
	margin-bottom:5px;
	margin-left:0;
	padding:20px;
	background-color:rgba(0,0,0,0.7);
	-webkit-box-sizing:border-box;
	-moz-box-sizing:border-box;
	box-sizing:border-box;
	text-align:center;
	width:140px;
	cursor:pointer;
}

.menu li.active {
	background-color:rgba(91,193,177,.75);
	cursor:default;
}

.menu li a {
	text-decoration:none;
	color:#fff;
}

.page {
	position:relative;
	background-color:rgba(0,0,0,0.7);
	width:70%;
	height:100%;
	position:fixed;
	left:-70%;
	overflow:hidden;
	z-index:10;
}

.page-content {
	position:absolute;
	width:55%;
	height:80%;
	top:10%;
	right:15%;
	color:#fff;
	overflow:auto;
}
            
          
!
            
              $(function() {

//Image by Ivaylo Yovchev (  http://ivayloyovchev.com/weddings )
  
	//elements
	var $menu = $(".menu");
	var $pages = $(".page");
	var $menuLi = $menu.find("li").not(".to-home");
	var $toHome = $menu.find(".to-home");
	
	//interna vars
	var currentPage = "";
	
	$toHome.on("click", function() {
		currentPage = "";
		TweenMax.to($pages, 0.5, {
			left: "-70%"
		});
		TweenLite.to($menuLi.filter(".active"), 0.5, {
			className: "-=active"
		});
	});
	
	$menuLi.on("click", function(event) {
		
		var $this = $(this);
		var thisHref = $this.find("a").attr("href");
		
		if (currentPage !== thisHref && $pages.filter(thisHref).length > 0) {
			currentPage = thisHref;
			TweenMax.to($pages, 0.5, {
				left: "-70%"
			});
			TweenMax.to($pages.filter(thisHref), 0.5, {
				left: 0
			});
			TweenLite.to($menuLi.filter(".active"), 0.5, {
				className: "-=active"
			});
			TweenLite.to($this, 0.5, {
				className: "+=active"
			});
		}
		
		event.preventDefault();
	});
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console