Pen Settings



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


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


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.


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.


                <header role="banner">
  <nav class="anchor-nav" role="navigation" id="menu">
    <a href="#intro" id="intro-anchor">Intro</a>
    <a href="#section-1" id="anchor1">Section 1</a>
    <a href="#section-2" id="anchor2">Section 2</a>
    <a href="#section-3" id="anchor3">Section 3</a>

<main class="full-screen" id="intro" role="main">
  <section class="full-screen blue" id="start">
    <h1>Anchor Navigation</h1>

  <section class="full-screen orange" id="section-1">
      <p>Section Uno</p>

  <section class="full-screen red" id="section-2">
      <p>Section Dos</p>

  <section class="full-screen blue" id="section-3">
      <p>Section Tres</p>


	Demo Styles: NOT REQUIRED
body {
  margin: 0;
  height: 100%

a {
  color: white;
  text-decoration: none;

a:hover {
  text-decoration: underline;
} {
  color: #000;
  text-decoration: underline;

p {
  margin: 0;
  padding: 0;

header {
  position: fixed;
  top: 10px;
  left: 10px;

section {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #EFEFEF;

.full-screen {
  display: flex;
  max-width:calc(1920px *3 );
  height: 100%; /* makes panels the entire window height */

.blue {
	background-color: #3883d8;
.red {
	background-color: #cf3535;
.orange {
	background-color: #ea6300;


                // Init controller
var controller = new ScrollMagic.Controller({
  globalSceneOptions: {
    duration: $('section').height(),
    triggerHook: .025,
    reverse: true
  vertical: false
var scenes = {
  'intro': {
    'start': 'intro-anchor'
  'scene2': {
    'section-1': 'anchor1'
  'scene3': {
    'section-2': 'anchor2'
  'scene4': {
    'section-3': 'anchor3'

for(var key in scenes) {
  // skip loop if the property is from prototype
  if (!scenes.hasOwnProperty(key)) continue;

  var obj = scenes[key];

  for (var prop in obj) {
    // skip loop if the property is from prototype
    if(!obj.hasOwnProperty(prop)) continue;

    new ScrollMagic.Scene({ triggerElement: '#' + prop })
        .setClassToggle('#' + obj[prop], 'active')

controller.scrollTo(function(target) {

  var wrapper = $("#intro"),
      $menu = $("#menu"),
      $window = $(window);

  $menu.on("click","a", function(){
      var $this = $(this),
          href = $this.attr("href"),
          topY = $(href).offset().top;$window, 1, {
              y: topY, 
              autoKill: true

    return false;