cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-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.

              <div class="nav">
  <button class="dark-grey-button club-demo-button" id="restart">restart</button>
<div class="animation">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/car.png" class="car" id="car">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/lift.png" class="lift" id="lift">
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/supervisor.png" class="man" id="man">

                html, body {
    margin: 0px;
    font-family: Arial, sans-serif;
  .animation {
    margin:20px auto;
  .car {
    position: absolute;
    width: 282px;
    height: 102px;
    left: -283px;
    top: 200px;
  .lift {
    width: 307px;
    height: 195px;
    left: 154px;
    top: 297px;
    position: absolute;
  .man {
    position: absolute;
    width: 71px;
    height: 118px;
    left: 600px;
    top: 182px;

.nav {
              var man = document.getElementById("man"),
    car = document.getElementById("car"),
    lift =  document.getElementById("lift"),
    restart = document.getElementById("restart")
    tl = new TimelineLite();

//Challenge requirements:
//Man should begin animating 1 second before car animation ends.
//One second after man animation ends both car and lift should go up simultaneously.

tl.to(car, 2, {x:445})
  .to(man, 1, {x:-150})
  .to(car, 1, {y:"-=160"})
  .to(lift, 1, {y:"-=160"});

restart.onclick = function() {

//to see how this should look when done, here are some files

// .mov: https://greensock.com/wp-content/uploads/custom/position-challenge/position-challenge.mov
// .gif: https://greensock.com/wp-content/uploads/custom/position-challenge/position-challenge.gif
Loading ..................