cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

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.

            
              <p>
TweenMax.to('#obj1', 2, { left: 300, delay: 0.5 });<br />
TweenMax.to('#obj2', 2, { left: 300, repeat: 2 });<br />
TweenMax.to('#obj3', 2, { left: 300, repeat: -1, yoyo: true });<br />
TweenMax.to('#obj4', 2, { left: 300, onComplete: compFunc });<br />
function compFunc() {
  TweenMax.to('#obj4', 2, { autoAlpha: 0.2 });
};
</p>

<p class="note">
1:delay:開始するタイミングを遅延させる(secondで設定)<br>
2:repeat:リピート回数を設定。-1を設定すると無限リピート<br>
3:yoyo:往復リピートさせる。repeatの設定が必要<br>
4:onComplete:アニメーション完了時にcompFuncを実行
</p>

<hr>

<div id="obj1" class="obj">1: delay: 0.5</div>
<div id="obj2" class="obj">2: repeat: 2</div>
<div id="obj3" class="obj">3: yoyo: true</div>
<div id="obj4" class="obj">4: onComplete</div>
            
          
!
            
              .obj {
  position: relative;  
  margin: 20px;
  padding: 5px;
  width: 150px;
  height: 25px;
}

#obj1 { background: #44A5CB; }
#obj2 { background: #DA6272; }
#obj3 { background: #F9DB57; }
#obj4 { background: #23AC0E; }

/* text ----------- */
p { font-size: 80%; }
.note { font-size: 75%; color: rgba(0,0,0,0.8); }

            
          
!
            
              // delay:開始するタイミングを遅延させる(secondで設定)
TweenMax.to('#obj1', 2, { left: 300, delay: 0.5 });

// repeat:リピート回数を設定。-1を設定すると無限リピート
TweenMax.to('#obj2', 2, { left: 300, repeat: 2 });

// yoyo:往復リピートさせる。repeatの設定が必要
TweenMax.to('#obj3', 2, { left: 300, repeat: -1, yoyo: true });

// onComplete:アニメーション完了時にcompFuncを実行
TweenMax.to('#obj4', 2, { left: 300, onComplete: compFunc });

function compFunc() {
  TweenMax.to('#obj4', 2, { autoAlpha: 0.2 });
};

            
          
!
999px
Close

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.

Go PRO

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

Console