Jump to content

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

pause onclick

Go to solution Solved by Carl,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts



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"),
       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 comment
Share on other sites

  • Solution

It looks like you are using jQuery, so something like

$("#myButton").click(function() {

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