Reset styles and rerun animation
See original GitHub issueHello,
i want rerun an animation, after i removed the extra styles, which added velocityjs. But it is not working. Here is a fiddle fiddle.
var element = document.getElementById('animate');
var animate = function()
{
Velocity(element, {translateX: 500}, {duration: 2000, queue: false, complete: function(){
element.removeAttribute('style');
animate();
}});
};
animate()
Have someone any idea, to manage this? Is there a reset function or something?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Restart CSS Animation
With CSS animations (ala @keyframes) it's not as easy as you might think to “restart” it. Let's say you set it to run...
Read more >Restart animation in CSS3: any better way than removing the ...
Just set the animation property via JavaScript to "none" and then set a timeout that changes the property to "" , so it...
Read more >Restarting a CSS Animation - KIRUPA
If you are just looking for the one snippet of code you need to add to make restarting a CSS animation possible, then...
Read more >Restart a CSS Animation With JavaScript | harrytheo.com
Restarting an animation is not as easy as I originally thought, by just adding and removing classes. Making this work was more tedious...
Read more >Restart CSS Animations in Email - Email On Acid
The key to restarting a CSS animation is to set the animation-name of an animation to 'none' and then setting it back to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi Rycochet,
i hope you can answer on closed Issued. Exactly what i have fiddled, i need for banner ad development. And in this case is easer to not know the “starting values”. Can the Cache be cleared by a function like “reset” - or “clear cache”? If not maybe its a good new feature.
Damn, it definitely looks like it should work from the source, can confirm that it doesn’t work. There is a hacky way to clear internal data, but I can’t remember what it is (having never used it or looked at the cache code) - instead could you clear the values via Velocity with a duration of
0
?