Pen Settings



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


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.


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.


                    <h1>Just scroll!</h1>
      <a class="navBut" href="#">&#9776;</a>
    <div class="nav">
        <li><a href="#">Store</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#">FAQ</a></li>

    <div class="intro mac"></div>
    <div id="mac" class="mac"></div>

    <div class="content">
        <h2>Apple iMac scrolling effect.</h2>
        The standard Lorem Ipsum passage, used since the 1500s

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC

"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

<div class="fasterContent">
  <p>I want to move this content at a different speed than the rest.</p>



                @import url(,700,800);

body {
  color: #333;
  font-family: Open sans;
  background: url('');
  background-attachment: fixed;
  background-size: 100% auto;

h1 {
  position: fixed;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 100%;
  text-align: center;
  font-size: 52px;
  z-index: 1000;
  color: rgba(255, 255, 255, 0.3);

.mac {
  height: 613px;
  width: 764px;
  margin: 1340px auto 100px;
  background: white url("") no-repeat 0 0;
  -webkit-background-size: 764px 613px;
  background-size: 764px 613px;
  backface-visibility: hidden;
  &.intro {
    position: fixed;
    width: 2548px;
    height: 2052px;
    -webkit-background-size: 100% auto;
    background-size: 100% auto;
    margin: 0;
    top: 0;
    left: 50%;
    margin-top: -300px;
    margin-left: -1274px;
    -webkit-transform-origin: 50%;
    -ms-transform-origin: 50%;
    transform-origin: 50%;

.content {
  width: 500px;
  margin: 0 auto 150px;

.content h2 {
  font-size: 52px;
  line-height: 1.0865;
  font-weight: 300;
  margin-bottom: 48px;

.content p {
  font-size: 18px;
  margin: 1em 0 0 0;
  line-height: 1.8;
  color: #555;
  font-weight: 400;

.content p a {
  color: #555;
  text-decoration: underline;

.fasterContent {
  width: 500px;
  margin: 0 auto;
  font-size: 1.3rem;
  color: white;
  top: 400px;
  position: absolute;
  z-index: 1001;
  left: 50%;

.nav {
   width: 100%;
  height: 0vh;
   background: #fafafa;
   z-index: 9997;
   top: 0px;
  left: 0px;
  position: fixed;
  float: left;
  ul {
    padding-left: 100px;
    list-style-type: none;
    li {
      display: inline;
      padding: 0px 20px;

.navBut {
  top: 20px;
  left: 20px;
  position: fixed;
  z-index: 9999;


                $(function() {
    var el = $('.intro'),
        mac = $('#mac'),
        offset = mac.offset(),
        windowHeight = $(window).height();

    $(window).on('scroll', function() {


        var windowTop = $(window).scrollTop(),
            scrollPercent = ( - windowTop) /,
            scale = 'scale(' + scrollPercent + ')';

        el.css('transform', scale);

        if (windowTop >= 940) {
        } else {
     $('body').css('background-position-Y', - Math.round($(this).scrollTop() * 0.2) + 'px');
       $('.fasterContent').css('top', - Math($(this).scrollTop() + 2)  + 'px');

/*  hide and show side nav*/
  var nav = $('.nav'),
      navBut = $('.navBut');{
    if(nav.height() === 0){
      nav.stop().animate({ height: '55px', opacity: '1.0' }, 300);
    } else {
      nav.stop().animate({ height: '0', opacity: '0.0' }, 300);