javascript - Cut a CSS transition short? -


i'm applying css transition element.

   target.style.transition = "color 10000ms ease";    target.style.color = "red"; 

under circumstances, want end state of transition reached immediately, without waiting transition finish.

if try

   target.style.transition = "color 0ms";    target.style.color = "red"; 

the current transition continues.

doing

   target.style.transition = "color 0ms";    target.style.color = "blue"; 

sets 'blue' immediately, while

   target.style.transition = "color 0ms";    target.style.color = "blue";    target.style.color = "red"; 

results in continuation of transition. (tried in both chrome , ff)

is there way stop transition?

to stop transition , reach end state immediately, use

target.style.transition = "none"; 

see demo.


Comments

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -