Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                        <svg class="slide" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 870 184" role="img">

   
          <g id="ozi">

          <circle id="testRoundRed" cx="50" cy="50" r="14" style="fill:red"/>

          <circle id="testRoundBlue" cx="100" cy="100" r="14" style="fill:blue"/>



        </g>
          
        </svg>
<div style="position:absolute; top:0; right:0; width:600px">


<p>Blue play() - only plays once</p>
<button class="bluetest01">play() blue test01</button>
<button class="bluetest02">play() blue test02</button>
<button class="bluetest03">play() blue test03</button>

<p>Blue retart() - but does not animate from current position</p>
<button class="bluetest04">restart() blue test01</button>
<button class="bluetest05">restart() blue test02</button>
<button class="bluetest06">restart() blue test03</button>
  
  <p>Red - good, desired effect but is there a way to call the animation form a timeline? not have to put all the animation set up in the click function, like in Blue play() above?</p>
<button class="redtest0">onclick function red test0</button>
<button class="redtest1">onclick function red test1</button>
<button class="redtest2">onclick function red test2</button>
  
  
<p>Test pause() then .invalidate().restart </p>
<button class="test01">test blue test01</button>
<button class="test02">test blue test02</button>
<button class="test03">test blue test03</button> 
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                ana01 = new TimelineMax({ paused: true});

ana02 = new TimelineMax({paused: true});

ana03 = new TimelineMax({paused: true});


ana01.to("#testRoundBlue", 1, {scale:"10%"}, 0);
     //.to(.......)
     //.to(.......)
     //.to(.......)
     //.to(.......)


ana02.to("#testRoundBlue", 1, {scale:"2%"}, 0);
     //.to(.......)
     //.to(.......)
     //.to(.......)
     //.to(.......)

ana03.to("#testRoundBlue", 1, {scale:"5%"}, 0);
     //.to(.......)
     //.to(.......)
     //.to(.......)
     //.to(.......)




$(document).ready(function(){

    $('.redtest0').click(function(){ 

        TweenMax.to("#testRoundRed", 1, {scale:"10%"}, 0);
    })
    $('.redtest1').click(function(){ 

        TweenMax.to("#testRoundRed", 1, {scale:"2%"}, 0);
    })
    $('.redtest2').click(function(){ 

          TweenMax.to("#testRoundRed", 1, {scale:"5%"}, 0);
    })




    $('.bluetest01').click(function(){ 
     
        ana01.play();  
    })
    $('.bluetest02').click(function(){ 

        ana02.play(); 
    })
    $('.bluetest03').click(function(){ 

        ana03.play(); 
    })



    $('.bluetest04').click(function(){ 
     
        ana01.restart();  
    })
    $('.bluetest05').click(function(){ 

        ana02.restart(); 
    })
    $('.bluetest06').click(function(){ 

        ana03.restart(); 
    })
  
  
    $('.test01').click(function(){ 
     
ana03.pause();
ana02.pause();
ana01.invalidate().restart();
    })
    $('.test02').click(function(){ 

ana01.pause();
ana03.pause();
ana02.invalidate().restart();
    })
    $('.test03').click(function(){ 

ana01.pause();
ana02.pause();
ana03.invalidate().restart();
   
    })



});

              
            
!
999px

Console