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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                

<ul>
  <li id="person1Btn">Simon Rich</li>
  <li id="person2Btn">Rodrigo Jefferson</li>
  <li id="person3Btn">Alice Jennings</li>
  <li id="person4Btn">Dr. Smedley Harms</li>
</ul>
<div id="main">
  <h1>Board Members</h1>
  <div class="section" id="person1Bio"><h2>Simon Rich</h2>
    <p>Simon Rich is an American business magnate, investor, programmer, inventor and cyclist. Rich is the former chief executive and current chairman of Flemington Coat Factory, the world’s largest winter coat company, which he co-founded with Kevin Rudebager.</p>
<p>He is consistently ranked in the Forbes list of the world's wealthiest people and was the wealthiest overall from 1995 to 2009.</p></div>
  <div class="section" id="person2Bio"><h2>Rodrigo Jefferson</h2>
  <p>Rodrigo Jefferson is best known for his role as CEO and founder of Mango Computer. Jefferson took the company from 0 to 10 employees in 7 short years and each them retired millionaires when the company was sold in 1999. Since then Jefferson has been advising many firms as a consultant. He spends his free time with his wife Judy and cat Freckles.</p></div>
  <div class="section" id="person3Bio"><h2>Alice Jennings</h2>
  <p>Alice Jennings has made a name for herself as one of the world's top importers and exporters. A true master of getting anything to anywhere. Her international relationships and knowledge of trade law make her well suited to be on the board. As the company grows Alice's expertise is key to opening doors in emerging international markets.</p></div>
  <div class="section" id="person4Bio"><h2>Dr. Smedley Harms</h2>
    <p>Dr. Smedley Harms has more degrees than an Arizona desert. Dr. Harms knowledge of the economy on a global scale is invaluable to the company's growth. His adversity to travel and daylight makes him well suited to spending long hours buried in research.</p>
    <p>His father was a Swiss immigrant and his American mother was of Polish-Italian heritage. He grew up in the community of Greenlawn, New York. In 1973, he attended college prep and engineering classes at Lawrence Technological University and graduated with a perfect score of 800 on the mathematical section of the SAT; a claim which he too-often uses as an icebreaker in social gatherings.</p>
    <p>He has been self-nominated for a Nobel Peace prize for the past 25 years. Although not once hearing a response from the Nobel Board, its this dedication and persistence that makes him one the company's most valued assets.</p>
    </div>
</div>
              
            
!

CSS

              
                body{
  font-family: sans-serif;
  margin-top:40px;
  visibility:hidden;
}

#main {
  margin-left:250px;
  width:800px;
}

.section{
  padding:20px 0 80px 0;
}

h1 {
  font-size:80px;
}

h2{
  font-size:48px;
  border-bottom:2px solid #ccc;
  padding-bottom:20px;
}


ul{
  position:fixed;
  top:150px;
}

li {
  width:160px;
  padding:10px;
  margin-bottom:1px;
  background-color:#111;
  color:#ccc;
  border-left:10px solid #333;
  cursor:pointer;
}

p {
  padding:20px 0px;
  font-size:24px;
  line-height:30px;
  color:#555;
}

.active { 
  background-color:#111;
  color:#89cd25;
  border-left:20px solid #89cd25;
}

p {
  position:relative;
}
              
            
!

JS

              
                var $person1Btn =  $("#person1Btn");
var $person2Btn =  $("#person2Btn");
var $person3Btn =  $("#person3Btn");
var $person4Btn =  $("#person4Btn");

var tl = new TimelineMax({repeat:-1, yoyo:true});
tl.staggerTo("p", 0.2, {left:200, rotation:20}, 0.1)

$person1Btn.attr("data-scrollPos", $("#person1Bio").offset().top);
$person2Btn.attr("data-scrollPos", $("#person2Bio").offset().top);
$person3Btn.attr("data-scrollPos", $("#person3Bio").offset().top);
$person4Btn.attr("data-scrollPos", $("#person4Bio").offset().top);

$("li").click(function(){
  var myScrollPos = $(this).attr("data-scrollPos")
  TweenLite.to(window, 1, {scrollTo:myScrollPos}); 
})

$("li").mouseenter(function(){
  TweenLite.to(this, 0.2, {className:"+=active"}); 
})

$("li").mouseleave(function(){
  TweenLite.to(this, 0.2, {className:"-=active"}); 
})

TweenLite.from($("body"), 0.5, {autoAlpha:0, marginTop:100});
TweenLite.from($("ul"), 0.5, {left:-500, delay:0.5});
              
            
!
999px

Console