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

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

              
                <body>

  <div id="container" class="clearfix">
    <div id="content" class="clearfix">
      <div class="col1">
        <nav class="mainNav">
          <a class="current" href="#page1">Link Page 1</a>
          <a href="#page2">Link Page 2</a>
          <a href="#page3">Link Page 3</a>
          <a href="#page4">Link Page 4</a>
          <a href="#page5">Link Page 5</a>
          <a href="#page6">Link Page 6</a>
        </nav>
      </div>
      <div id="main">
        <div id="page1" data-title="page1" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 1
            </header>
            <p><a class="actionPlanLink" href="#page4">Lets link to page 4</a></p>
          </div>
        </div>
        <div id="page2" data-title="page2" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 2
            </header>
            <p><a class="actionPlanLink" href="#page5">Lets link to page 5</a></p>
          </div>
        </div>
        <div id="page3" data-title="page3" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 3
            </header>
            <p><a class="actionPlanLink" href="#page2">Lets link to page 2</a></p>
          </div>
        </div>
        <div id="page4" data-title="page4" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 4
            </header>
            <p><a class="actionPlanLink" href="#page2">Lets link to page 2</a></p>
          </div>
        </div>
        <div id="page5" data-title="page5" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 5
            </header>
            <p><a class="actionPlanLink" href="#page6">Lets link to page 6</a></p>
          </div>
        </div>
        <div id="page6" data-title="page6" class="tabsContainer clearfix">
          <div class="col2">
            <header>Page 6
            </header>
            <p><a class="actionPlanLink" href="#page2">Lets link to page 2</a></p>
          </div>
        </div>

      </div>
    </div>
  </div>
              
            
!

CSS

              
                @import "compass/css3";

body{
  font-family:Arial, sans-serif;
}

a{
  text-decoration: none;
}

#container{
	width:960px;
	margin:auto;
}

	#content{
		width:100%;
		height:630px;
	}

	#main{
		width:768px;
		height:630px;
		float:right;
		margin:0;
	}

	.col1{
		float:left;
		width:25%;
		max-width:186px;
		margin-right:6px;
		height:100%;
	}

	.col2{
		float:right;
		width:670px;
		height:390px;
		margin:6px 0;
		background:#e8f0f0;
		padding:15px;
	}

header{
  background:#34a747;
  color:white;
  font-size:2em;
  padding:12px;
}

.mainNav {
	width:100%;
    display: block;
    float: left;
    margin:6px 0;

	a {
	    background:#34a747;
	    margin-bottom: 6px;
	    font-size:20px;
	    line-height:2em;
	    font-weight:500;
	    cursor:pointer;
	    color:white;
	    float: left;
	    display: block;
	    width:100%;
	    padding:12px 10px;

		&:hover, &:focus{
		    color:#191051;
			background:#e3e3e2;		
    }

		}
		a.current {
		    color:#191051;
			background:#e8f0f0;
		}

    }

.mainNav a.current:hover {
    cursor:default;
	text-decoration:none;
}

.tabsContainer{
	margin:0 auto 0 auto;
	width: 100%;
	max-width:768px;
	height:100%;
	position: absolute;
}

.tabs{
	margin: 0 auto;
	height:580px;
}
              
            
!

JS

              
                jQuery(document).ready(function($) {

  /*
  	Author: Chrysto Panayotov ( [email protected] )
  	For GSAP forums user mulegoat based on hes code
  	
  	We use caching the DOM and filter() because they're faster than creating jQuery selection every time
  	
  */

  var $sections = $(".tabsContainer");
  var $nav = $("nav.mainNav a");
  var $internalNav = $("a.actionPlanLink");
  var currentTabID = "";
  var prevTabID = "";

  function initpageNav() {

    $nav.add($internalNav).on("click", gotoPageSection); //use add() to merge selection

  }

  function gotoPageSection(e) {

    var $this = $(this);
    clickedTabID = $this.attr("href"); //get the current href attribute

    if (clickedTabID !== currentTabID) { //if current page is different than previous

      if ($sections.filter(clickedTabID).length > 0) { //if current section exists at DOM

        prevTabID = currentTabID;
        currentTabID = clickedTabID;

        //changes the tab
        TweenLite.to($sections.filter(prevTabID), 0.5, {
          autoAlpha: 0
        });
        TweenLite.to($sections.filter(currentTabID), 0.5, {
          autoAlpha: 1,
          delay: 0.3
        }); //add delay so tabs don't overlap 

        //update the nav TweenMax way
        TweenLite.to($nav.filter(".current"), 0.5, {
          className: "-=current"
        });
        TweenLite.to($nav.filter('[href="' + currentTabID + '"]'), 0.5, {
          className: "+=current"
        });

      }
    }

    e.preventDefault(); //keeps window on the same position	

  }

  function init() {
    initpageNav();
    TweenLite.set($sections, {
      autoAlpha: 0
    }); //hide all tabs initially 
    TweenMax.staggerFrom(".mainNav a", 0.2, {
      autoAlpha: 0,
      scale: 0.5,
      delay: 0.6
    }, 0.1);
    $(".mainNav a")[0].click();
  }

  init();

});
              
            
!
999px

Console