html - CSS transition 0s (zero seconds) not working? -
i want avoid of transition effects on element (for example: opacity
). should use opacity 0s
, because should default value or in other words transition have no effect on this. it's not working way. tried:
div { width: 100px; height: 100px; opacity: 0.5; background: red; -webkit-transition: 2s, opacity 0s; transition: 2s, opacity 0s; } div:hover { width: 300px; opacity: 1; }
<div></div>
div { width: 100px; height: 100px; opacity: 0.5; background: red; -webkit-transition: 2s, opacity 0.1s; transition: 2s, opacity 0.1s; } div:hover { width: 300px; opacity: 1; }
<div></div>
however, if 0s
of opacity
changed 0.1s
, work(with duration of 0.1s), there way "disable" animation in other way, perhaps, work without small value 0.1s?
here solution this
transition: 2s, opacity 1ms;
as 0s
not valid time (i don't know why this). , 1ms
small time 0s
human eye.
and current problem can use transition: width 2s
applicable width
.
Comments
Post a Comment