Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Auto Save

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.

HTML

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

CSS

              
                .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); }

              
            
!

JS

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

Console