【发布时间】:2014-06-24 01:35:00
【问题描述】:
我在div 上创建了一个过渡效果。我已经编写了以下代码并且它工作正常,当我在hover 上div 时,颜色会平滑地变化,但是当我移除鼠标时,颜色会突然恢复到原来的状态。
我也想知道Mouse outEvent上慢慢改变颜色的方法。
请检查我的代码并指导我。
<nav>
<ul>
<li id="skills" class="navText" >Work -Experience</li>
<li id="web" class="navText">Skills </li>
</ul>
</nav>
CSS
nav ul #skills
{
position:absolute;
width: 150px;
height: 150px;
border:6px solid;
border-color:white;
border-radius: 150px;
line-height:150px;
font-size: 15px;
#background-color: EA7079;
background-color: #1A1A1A;
color: white;
left:370px;
}
nav ul #skills:hover
{
position:absolute;
width: 150px;
height: 150px;
border:6px solid;
border-color: #DCDEE0;
border-radius: 150px;
line-height:150px;
font-size: 15px;
background-color: EA7079;
color: white;
left:370px;
/* CSS3 */
-webkit-transition: all 1000ms ;
-moz-transition: all 1000ms ;
-ms-transition: all 1000ms ;
-o-transition: all 1000ms ;
transition: all 1000ms ;
}
【问题讨论】:
标签: javascript jquery css mousehover