Jump to content

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

One Timeline.play() triggers another's play()

Recommended Posts

As you can see, I am trying to see if Timeline's progress is 0, then I play it and it expands the menu (empty) underneath, if it's 1, then it reverses it and folds the menu. Individually, everything works as intended.


However, in order to avoid overlap of menus, I want to close the "other" menu before opening the target one, so I do Timeline.progress(0) to simply reset it to it's folded state.


Unfortunately, this causes the timeline to reset to 0, and then to start playing again, which is not expected from the code...


What am I doing wrong?

See the Pen XNoQZM by IGaMbLeRI (@IGaMbLeRI) on CodePen

Link to post
Share on other sites

Nevermind, a simple .pause() after .progress(0) has solved it. Codepen updated.

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