Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
lynette

pause onclick

Recommended Posts

Hi, 

 

Is there a way to add an pause onclick?

 

 Here is my code: 

 

 var $container = $("#container"),
            $content = $("#content"),
            $bg = ("#bg"),
            $panel1 = ("#panel1"),
            $panel2 = ("#panel2"),
            $panel3 = ("#panel3"),
            $line1 = ("#line-1"),
            $line2 = ("#line-2"),
            $line3 = ("#line-3"),
            $line4 = ("#line-4"),
            $btn = ("#btn"),
            $exit = ("#exit"),
            tl;
 
       var tl = new TimelineMax({repeat:2})
        
        tl.from($line1, 1, {opacity:0},"+=2.25")
          .to($line1, 0.5, {opacity:0})
          .from($line2, 2, {opacity:0})
          .to($line2, 0.85, {opacity:0})
          .from($line3, 2, {opacity:0}, "go")
          .from($line4, 2, {opacity:0}, "go")
          .from($btn, 2, {opacity:0}, "go")
 
Link to post
Share on other sites

It looks like you are using jQuery, so something like

$("#myButton").click(function() {
   tl.pause();
});

Similar to your other post, its hard to give exact advice without a small demo.

 

Here is an example from our Jump Start demos: http://codepen.io/GreenSock/pen/Dtqwz

  • Like 1
Link to post
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.

×