cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


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.

                  <h1>Just scroll!</h1>

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

    <div class="content">
        <h2>Apple iMac scrolling effect.</h2>
        iMac 27" mockup by <a href="https://dribbble.com/shots/438772-iMac-27-Fully-Scalable-PSD" target="_blank">Koy Carraway</a>.<br/>
        Picture from <a href="http://wallwidehd.com">WallWideHD</a> - Transfagarasan.<br/>
        Read more about Transfagarasan <a href="http://en.wikipedia.org/wiki/Transf%C4%83g%C4%83r%C4%83%C8%99an" target="_blank">here</a>.

              @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,800);

body {
  color: #333;
  font-family: Open sans;

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: 999;
  color: rgba(255, 255, 255, 0.3);

.mac {
  height: 613px;
  width: 764px;
  margin: 1340px auto 100px;
  background: white url("https://raw.githubusercontent.com/balajmarius/Apple-iMac-Parallax/master/assets/images/bg.jpg") no-repeat 0 0;
  -webkit-background-size: 764px 613px;
  background-size: 764px 613px;
  backface-visibility: hidden;

.mac.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;
              $(function() {
    var el = $('.intro'),
        mac = $('#mac'),
        offset = mac.offset(),
        windowHeight = $(window).height();

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


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

        el.css('transform', scale);

        if (windowTop >= 940) {
        } else {


Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.


Loading ..................