Skip to content

Does removing DOM Element remove associated Tweens? #625

Closed Answered by trusktr
Madhav-Malhotra asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

This is the wrong Tween library you are asking about, but the following answer will apply to both anyway.

There is Tween.js (you're looking at it right now) started in May 2010, and TweenJS started in March 2011. So our name wins. 😛

Anyway, to answer your question: no, tweens (from either lib) do not automatically stop when you remove a DOM element. They can not make this assumption because they do not know what you are animating (you could animate the properties of any object other than a DOM element).

So, if you happen to be animating properties on a DOM element (which doesn't make sense unless you also use CSSPlugin with TweenJS (not Tween.js)), then if you want to remove the el…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Madhav-Malhotra
Comment options

@trusktr
Comment options

Answer selected by trusktr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants