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.


                <div id="dot_menu">
  <div class="icon"></div>
<section class="section1">
	<h1>Section 1</h1>
<section class="section2">
	<h1>Section 2</h1>
<section class="ignoreme">
  <h1>Some items are not in the nav.</h1>
<section class="section3">
	<h1>Section 3</h1>
<section class="section4">
	<h1>Section 4</h1>
<section class="section5">
	<h1>Section 5</h1>


                body {
  margin: 0;
  width: 100%;
  background-color: grey;
  font-family: sans-serif;
  overscroll-behavior: none;
section {
  position: relative;
  height: 100vh;
  border-bottom: 1px solid #636363;
  width: 58%;
h1 {
  position: absolute;
  top: 30px;
  font-size: 36px;
  line-height: 1;
  font-family: sans-serif;
  color: #fff;
  margin: 0 0 0 20px;
#dot_menu {
  position: fixed;
  right: 10px;
  top: 20%;
#dot_menu > .icon {
  width: 20px;
  height: 20px;
  background: red;
  margin: 3px 0px;
#dot_menu > {
  background: green;


                // Save template for dots
var circle = $("#dot_menu").html();

// Amount of sections is dynamic, so we need to determine how many showed up first
var sectionCheck = gsap.utils.toArray("[class*='section']"); 
// Empty placeholder dots

// Perform function on each anchor

function sectionTrigger(item, i) {
  // Generate a new dot for this anchor 
  var new_dot = $(circle);
          // Add an 'active' class to this dot when we go into its section
, {
            scrollTrigger: {
              trigger: item,
              start: 'top 50%',
              end: 'top -50%',
              scrub: true,
              onToggle: self => self.isActive ? new_dot[0].classList.add("active") : new_dot[0].classList.remove("active")