CSS Webkit Transition - Fade out slowly than Fade in

后端 未结 2 1788
耶瑟儿~
耶瑟儿~ 2021-01-07 20:52

This is what I have:

.box{
    background:#FFF;
    -webkit-transition: background 0.5s;
}

.box:hover{
    background:#000;
}

But this app

相关标签:
2条回答
  • 2021-01-07 21:14

    Just redifine your transition in the over pseudo element.

    .box{
        background: white;
        -webkit-transition: background 5s;
    }
    .box:hover{
        background: olive;
        -webkit-transition: background 1s;
    }
    

    Look my http://jsfiddle.net/DoubleYo/nY8U8/

    0 讨论(0)
  • 2021-01-07 21:20

    Either use an animation (only in webkit currently), or use JS to add and remove the properties, they will still animate.

    0 讨论(0)
提交回复
热议问题