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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

              
                <div class="buttons">
  <button type="button" class="btn btn-down">scroll down</button>
  <button type="button" class="btn btn-up">scroll up</button>  
</div>

<section>
  <div class="cat f00"></div>
</section>
<section>
  <div class="cat f01"></div>
</section>
<section>
  <div class="cat f02"></div>
</section>
<section>
  <div class="cat f03"></div>
</section>
<section>
  <div class="cat f04"></div>
</section>
<section>
  <div class="cat f05"></div>
</section>
<section>
  <div class="cat f06"></div>
</section>
<section>
  <div class="cat f07"></div>
</section>
<section>
  <div class="cat f08"></div>
</section>
<section>
  <div class="cat f09"></div>
</section>
<section>
  <div class="cat f10"></div>
</section>
<section>
  <div class="cat f00"></div>
</section>
<section>
  <div class="cat f01"></div>
</section>
<section>
  <div class="cat f02"></div>
</section>
<section>
  <div class="cat f03"></div>
</section>
<section>
  <div class="cat f04"></div>
</section>
<section>
  <div class="cat f05"></div>
</section>
<section>
  <div class="cat f06"></div>
</section>
<section>
  <div class="cat f07"></div>
</section>
<section>
  <div class="cat f08"></div>
</section>
<section>
  <div class="cat f09"></div>
</section>
<section>
  <div class="cat f10"></div>
</section>
<section>
  <div class="cat f00"></div>
</section>
<section>
  <div class="cat f01"></div>
</section>
<section>
  <div class="cat f02"></div>
</section>
<section>
  <div class="cat f03"></div>
</section>
<section>
  <div class="cat f04"></div>
</section>
<section>
  <div class="cat f05"></div>
</section>
<section>
  <div class="cat f06"></div>
</section>
<section>
  <div class="cat f07"></div>
</section>
<section>
  <div class="cat f08"></div>
</section>
<section>
  <div class="cat f09"></div>
</section>
<section>
  <div class="cat f10"></div>
</section>
<section>
  <div class="cat f00"></div>
</section>
<section>
  <div class="cat f01"></div>
</section>
<section>
  <div class="cat f02"></div>
</section>
<section>
  <div class="cat f03"></div>
</section>
<section>
  <div class="cat f04"></div>
</section>
<section>
  <div class="cat f05"></div>
</section>
<section>
  <div class="cat f06"></div>
</section>
<section>
  <div class="cat f07"></div>
</section>
<section>
  <div class="cat f08"></div>
</section>
<section>
  <div class="cat f09"></div>
</section>
<section>
  <div class="cat f10"></div>
</section>
              
            
!

CSS

              
                body {
  background-color: #fff;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.buttons {
  position: fixed;
  top: 15px;
  right: 15px;
}

section {
  height: 100vh;
  
  .cat {
    height: 100%;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
  }
}
.f00 {
      background-image: url(http://andrevv.com/img/horse/01.png);
}
.f01 {
  background-image: url(http://andrevv.com/img/horse/02.png);
}
.f02 {
  background-image: url(http://andrevv.com/img/horse/03.png);
}
.f03 {
  background-image: url(http://andrevv.com/img/horse/04.png);
}
.f04 {
  background-image: url(http://andrevv.com/img/horse/05.png);
}
.f05 {
  background-image: url(http://andrevv.com/img/horse/06.png);
}
.f06 {
background-image: url(http://andrevv.com/img/horse/07.png);
}
.f07 {
  background-image: url(http://andrevv.com/img/horse/08.png);
}
.f08 {
  background-image: url(http://andrevv.com/img/horse/09.png);
}
.f09 {
  background-image: url(http://andrevv.com/img/horse/10.png);
}
.f10 {
  background-image: url(http://andrevv.com/img/horse/11.png);
}
              
            
!

JS

              
                $('.btn-down')
  .on('click', (e) => {
    $('html, body').animate({
      scrollTop: +$(document).height()
    }, 3000);
  });

$('.btn-up')
  .on('click', (e) => {
    $('html, body').animate({
      scrollTop: 0
    }, 3000);
  });
              
            
!
999px

Console