CSS Webkit过渡 - 淡出慢于淡入 [英] CSS Webkit Transition - Fade out slowly than Fade in

查看:138
本文介绍了CSS Webkit过渡 - 淡出慢于淡入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我所拥有的:

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

.box:hover{
    background:#000;
}

但这会附加到 onmouseover > onmouseout 操作,但是没有一种方法来控制它们?例如:

But this appends to both onmouseover and onmouseout actions, but isn't there a way to control them? Something like:

-wekbkit-transition-IN: background 1s;
-webkit-transition-OUT: background 10s;


推荐答案

/ p>

Just redifine your transition in the over pseudo element.

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

查看我的http://jsfiddle.net/DoubleYo/nY8U8/

这篇关于CSS Webkit过渡 - 淡出慢于淡入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆