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 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.

Quick-add: + add another resource

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.

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
Loading ..................

Console