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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -