Jump to content
Search Community

a lot of TweenMax reset and repeat

Uso test
Moderator Tag

Recommended Posts

Hello!
I don't speak English well ..


I have a question using TweenMax I'm asking the right question here?

 

I want Controlling a lot of TweenMax in my project

 

I want visual() function run -> reset 

I want to Infinite repeat this function

 

Please help me. I am a beginner. ?

 

 

I made the code like this.  ⬇️

 

 

<script type="text/javascript">
      $(document).ready(function() {
        var visual= function() {
           var $con_03_mobile = $('.top_con .motion_mobile')
             , $con_03_01 = $('.con_03 .motion01')
             , $con_03_02 = $('.con_03 .motion02')
             , $con_03_03 = $('.con_03 .motion03')
             , $con_03_04 = $('.con_03 .motion04')
             , $con_03_05 = $('.con_03 .motion05')
             , $dim1 = $('.con_03 .dim1')
             , $dim2 = $('.con_03 .dim2')
             , $mask = $('.con_03 .mask')
             , $mask2 = $('.con_03 .mask2')

             function a5(){
               TweenMax.fromTo($con_03_04, 0.6, {x:'8px', y:'184'}, {x:'8px',y:'8px', ease: Power2.easeIn, onComplete: function(){
                 TweenMax.fromTo($con_03_05, 0.3, {opacity:'0'}, {opacity:1, ease: Power2.easeIn, onComplete: function(){
                 }});
               }});
               TweenMax.fromTo($con_03_04, 0.1, {opacity:'0'}, {opacity:1, ease: Power2.easeIn, onComplete: function(){
               }});
             }
            function a4(){
              TweenMax.fromTo($dim1, 0.5, {opacity:'0'}, {opacity:0.8, ease: Power2.easeIn, onComplete: function(){
              }});
              TweenMax.fromTo($con_03_03, 0.7, {x:'8px', y:'184'}, {x:'8px',y:'8px', ease: Power2.easeIn, onComplete: function(){
                TweenMax.fromTo($con_03_03, 0.3, {opacity:'1'}, {opacity:0, ease: Power2.easeIn, onComplete: function(){
                }});
                setTimeout(a5, 100)
              }});
              TweenMax.fromTo($con_03_03, 0.1, {opacity:'0'}, {opacity:1, ease: Power2.easeIn, onComplete: function(){
              }});
            }
            TweenMax.fromTo($con_03_02, 0.8, {x:'200', y:'0'}, {x:'8px',y:'8px', ease: Power2.ease, onComplete: function(){
              setTimeout(a4, 200)
            }});
      }

});

 

 

 

 

Link to comment
Share on other sites

success like this

 

 

<script type="text/javascript">
      $(document).ready(function() {
        var visual03 = function() {
          var $con_03_mobile = $('.top_con .motion_mobile')
            , $con_03_01 = $('.con_03 .motion01')
            , $con_03_02 = $('.con_03 .motion02')
            , $con_03_03 = $('.con_03 .motion03')
            , $con_03_04 = $('.con_03 .motion04')
            , $con_03_05 = $('.con_03 .motion05')
            , $dim1 = $('.con_03 .dim1')
            , $dim2 = $('.con_03 .dim2')
            function resetAll() {
              timeLine01.pause(0);
              timeLine01.restart(1);
            }
            var timeLine01 = new TimelineMax();
            timeLine01.to($con_03_02, 0.8, {x:'8px', y: '8px', ease: Power2.easeIn, onComplete: function(){
              timeLine01.to($dim1, 0.5, {opacity:0.8, ease: Power2.easeIn, delay: 0.2, onComplete: function(){
              }});
              timeLine01.fromTo($con_03_03, 0.4, {x:'8px', y:'374'}, {x:'8px',y:'8px', ease: Power2.ease,delay: 0.2, onComplete: function(){
                timeLine01.fromTo($con_03_03, 0.2, {opacity:'1'}, {opacity:0, ease: Power2.ease, delay: 0.3, onComplete: function(){
                }});
                timeLine01.fromTo($con_03_04, 0.4, {x:'8px', y:'150'}, {x:'8px',y:'8px', ease: Power2.easeIn, onComplete: function(){
                  timeLine01.to($con_03_05, 0.5, {opacity:1, ease: Power2.ease, delay: 0.5, onComplete: function(){
                    TweenMax.delayedCall(0.6, resetAll);
                  }});
                }});
              }});
            }});
      }

});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...