question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reverse callback?

See original GitHub issue

I’m playing an animation, but on complete: I change a few hidden css properties (irreversibly), and I’d really much like to find a way to “undo” them because obviously, they do not change back when the animation is reversed… Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Jan 2, 2018

Dunno about you guys, but in 2.2.0 I had to do more than completed=false. These are all required changes for the begin and/or complete timeline callbacks to be called.

timeline.began=timeline.completed=false;
timeline.loop=timeline.progress=0;
timeline.reverse();

timeline.begin = _ => console.log('> new begin callback');
timeline.complete = _ => console.log('> new complete callback');

timeline.play();
1reaction
digital-flowerscommented, Aug 30, 2017

for the time being i think this little hack will work:

    myTimeline.completed = false;
    myTimeline.complete = () => { 
        // your call back funtion
        console.log("reverse done 😏");
    };
    myTimeline.reverse();
    myTimeline.play();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reverse Phone Lookup | Phone Number Search - Whitepages
Whitepages reverse phone lookup service is free. Enter a phone number, search and find the phone owner's full name, address and more.
Read more >
How can I reverse the callback function? - GSAP - GreenSock
Hi guys! I am a beginner at JavaScript. I created codepen with hover animation. So, when I hover the blue square, the first...
Read more >
Reverse return value of callback with function - not(callback)
The idea is to have the isNot function return a function which simply negates the result of the passed as parameter function. Share....
Read more >
Reverse Callback Templating - Perl.com
Effectively, this is the opposite of the callback method, which wraps Perl logic around portions (or sections) of a template in a single...
Read more >
Reverse Phone Lookup | Find People By Phone Number
Anywho's Reverse Phone Lookup service allows you to enter in a phone number and lookup who it is registered to. Run a phone...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found