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

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

javascript - Can Piwik report referrer in real time? -