css3 - css - make the transition works just for one way -


i have following code in css:

.item {     opacity: 0;     transition: opacity 1s linear;     -webkit-transition: opacity 1s linear;     -moz-transition: opacity 1s linear; }  .item.seen {     opacity: 1; } 

when add class seen .item, opacity of item turn 0 1 transition.

but when remove class seen .item opacity transition (from 1 0) runs.

is there way make transition run when .seen added not when removed?

.item {     opacity: 0; }  .item.seen {     opacity: 1;     -webkit-transition: opacity 1s linear;     -moz-transition: opacity 1s linear;     transition: opacity 1s linear; } 

fiddle: http://jsfiddle.net/qcxt3evn/ (with opacity set 0.2 purpose of seeing clickable element)

also, don't forget place standard property after vendor-prefixed (the latter might non-compliant specification)


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -