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

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.

HTML

              
                <html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<header>Header</header>
<article>
  <section id="section-1">
    <h1>Section 1</h1>
    <p>Post launch agile follow up digest copy deck client-facing streamline. Take a stab at it copy deck affiliate marketing cohesive SEO. Good fit pivot game plan discovery on your plate target audience plow through functionality internally. In the queue streamline traction whiteboard optimize. Push the envelope post launch credentials retainer. Dynamic cross platform third party implementation mission statement gear up strategic partners leverage reach. Lean retainer ROI discovery gear up. Affiliate marketing take a stab at it channels deliverables post launch look and feel gear up. Tweak synergy kick-off leverage.</p>
  </sections>

  <section id="section-1a">
    <h2>Section 1a</h2>
    <p>Okay, yeah I think the word program I used to design that doesn't have the strongest pixels. The government blocked javascript or something... That's why my Yahoo mail isn't coming onto my phone. Make the logo bigger. I want them to know what website they're on. Looks good, but... We may want to put a sunrise on it.</p>

    <p>We think it would be better to stick with darker bright colors. Instead of the boring image of a "hand" when a client clicks on something, please make it a small (but friendly) garden insect - e.g. a butterfly, grasshopper, or hummingbird. Please avoid insects with negative connotations, e.g. a slug, caterpillar, or hawk. Looks good, but... Hey, I know it's been a while, but do you happen to know our office WiFi password? We may want to put a sunrise on it. Looks good, but... Well I don't like the pages who has loading when you get to the website, I don't want to have to wait.</p>

    <p>I don't like circles. We were hoping to see some more design in the design. None of our hyperlinks are working. We don't know where it's trying to link to. We just underlined the text and were not further prompted. Look, I've been using the internet since the 90's... So I could probably design this site myself. You're more like a second opinion. I like it but can you change it? We may want to put a sunrise on it. Overall perhaps we could somehow exchange some color for dimension/depth/texture? And by dimension/depth/texture I just mean "3d-ness" of the boxes or the buttons.</p>
  </section>

  <a class="page-anchor"></a>
  <section id="section-1b">
    <h2>Section 1b</h2>
    <p>Organic value-add pipeline target audience internally lead generation. Dynamic gear up high-level ROI whiteboard. Copy deck high-level regroup cohesive next level proximity transparent ETA. Above the fold responsive behavior discovery traction.</p>

    <p>User persona pipeline bandwidth SEO. Conversion mobile-first traction proximity consolidate client-facing. Plow through traction SEO synergy value creation reach target audience mission statement synergy. Post launch B2B conversion lean game plan value creation channels leverage dev environment.</p>

    <p>Credentials affiliate marketing ETA above the fold value proposition push the envelope. Channels next steps SEO API digest mission statement discovery. Channels retainer pivot implementation value proposition post launch conversion plow through. Fluid dev environment lead generation bandwidth usability mock up tweak pivot. Proximity next steps mobile-first cohesive organic reach credentials regroup. Game changer agile game plan game changer segment. Heads down above the fold game changer proposed fluid ROI onboarding. Mock up game changer follow up value proposition SEO. Heads down whiteboard high-level lead generation look and feel.</p>
  </section>

  <section id="section-2">
    <h1>Section 2</h1>
    <p>I'll know it when I see it. We're just not seeing that "ka-pow" factor. I'm not sure about the colour that you've used for the background, I guess it looks OK on screen but when I print it on our office printer it kinda reminds me of a pair of corduroys I had as a child. Can you make the logo bigger?</p>

    <p>The design needs to be less liney. There are too many lines. Hey, I know it's been a while, but do you happen to know our office WiFi password? The design needs to be less liney. There are too many lines. Can we add transitions like in PowerPoint?</p>

    <p>We think it would be better to stick with darker bright colors. I did this at home with Microsoft Paint. Can you use a "clear" background on my website? No, not white. Transparent. I think the internet is down. We want it to look very "Web 2.0". I don't like circles. We're just not seeing that "ka-pow" factor. Let's get a QR code of our website and add it on our website.</p>
  </section>

  <section id="section-3">
    <h1>Section 3</h1>
    <p>Third party lead generation client-facing onboarding next level good fit segment. OLA reach leverage push the envelope organic mobile-first. Follow up CTA mock up pivot ecosystem lead generation look and feel. Strategic partners SEO B2B traction next level strategic partners value creation plow through mission statement. User persona tweak prototype ramp up B2B optimize prototype proposed. Pipeline above the fold synergy cohesive streamline game changer. In the queue organic next level digest. Streamline API dynamic .</p>

    <p>Proposed tweak on your plate synergy next steps discovery. Mock up third party proximity follow up. Value creation dynamic cohesive in the queue. Reach heads down tackle it strategic partners lean push the envelope value proposition high-level. Scope out functionality tweak flesh out third party.</p>

    <p>Onboarding responsive behavior innovation optimize. EOD whiteboard heads down traction ecosystem ROI game changer. Value-add value proposition game plan copy deck. Proposed hackathon good fit value-add. CTA usability retainer ecosystem strategic partners gear up ecosystem EOD. Game plan ROI organic EOD internally. Discovery copy deck whiteboard game changer ecosystem ETA lead generation onboarding strategic engagement.</p>
  </section>

  <section id="section-4">
    <h1>Section 4</h1>
    <p>SEO proximity conversion streamline regroup whiteboard. Deliverables onboarding pivot SEO scope out reach B2B optimize. Next level segment mission statement reach third party onboarding. Cross platform high-level strategic engagement gear up copy deck ETA B2B cross platform plow through. Pivot game plan retainer ETA flesh out copy deck whiteboard pivot post launch. Lean client-facing value proposition look and feel ROI. Lead generation post launch high-level usability.</p>

    <p>Traction proximity consolidate strategic engagement lead generation ecosystem segment next level discovery. Third party strategic engagement implementation traction client-facing cross platform third party. Fluid pivot value creation post launch. Optimize bandwidth cross platform traction organic bandwidth optimize proposed. Organic leverage ramp up mock up dev environment OLA ROI.</p>

    <p>Take a stab at it cross platform kick-off mobile-first high-level push the envelope onboarding mission statement. Post launch usability on your plate cross platform channels above the fold on your plate. Lean optimize synergy responsive behavior regroup prototype user persona. Leverage fluid ETA consolidate take a stab at it. Ramp up fluid transparent gear up dynamic. Scope out strategic partners mock up reach above the fold.</p>
  </div>
</article>

<nav id="sidebar">
  <h1>Contents</h1>

  <ul class="sidebar-nav">
    <li><a href="#section-1">Section 1</a>
      <ul>
        <li><a href="#section-1a">Section 1a</a></li>
        <li><a href="#section-1b">Section 1b</a></li>
      </ul>
    </li>
    <li><a href="#section-2">Section 2</a></li>
    <li><a href="#section-3">Section 3</a></li>
    <li><a href="#section-4">Section 4</a></li>
  </ul>
</nav>

</body>
</html>
              
            
!

CSS

              
                body, html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

h2 {
  font-size: 1em
}

header {
  width: 100%;
  height: 75px;
  background-color: #CCC;
}

article {
  display: inline-block;
  width: 60%;
}

ul {
  padding: 0;
  margin: 0 0 0 15px;
  list-style-type: none;
}

.current {
  color: #000;
  text-decoration: none;
}

#sidebar {
  display: inline-block;
  position: absolute;
  right: 10%;
  top: 175px;
  width: 20%;
  padding: 20px;
  border: 1px solid black
}

#sidebar.is-fixed {
  position: fixed;
  top: 100px;
}
              
            
!

JS

              
                $(window).resize(function() {
  
  var anchors = $('section').map(function(i) {
    return {
      height: $(this).position().top,
      link: $('a[href="#' + $(this).attr('id') + '"]')
    };
  });

  var navLength = anchors.length;

  $(window).scroll(function(){

    var scrollPosition = $(window).scrollTop();

    if(scrollPosition >= 75){
      $('#sidebar').addClass('is-fixed');
    } else {
      $('#sidebar').removeClass('is-fixed');
    }

    for (var i = navLength - 1; i >= 0; i--) {
      if (scrollPosition >= anchors[i].height - 10) {
        $('.sidebar-nav a').removeClass('current');
        anchors[i].link.addClass('current');
        return;
      }
    }
  });
}());
              
            
!
999px

Console