I need to replay a css transition using javascript.
When I reset css style of my div and apply the new transition, nothing happens...
I think both code are executed in the same execution frame and by optimisation, it doesn't change anything...
Example : https://jsfiddle.net/f0s8a8jp/2/
test.css({transition: 'none', height: '0px'});
test.css({transition: 'height 1s linear', height: '100px'});
The only solution I found for the moment (not realy clean for me), is to use setTimeout beetween the properties reset and the application of new transition : https://jsfiddle.net/f0s8a8jp/3/
Better idea is welcome?!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…