【发布时间】:2012-07-27 09:22:05
【问题描述】:
我想减慢 .opacity CSS 属性中的动画时间。 就像,我希望它延迟 0.2 毫秒或类似的东西。
为了更好地了解,当悬停在我的网站上的精选帖子时会添加不透明度:http://www.thetechnodaily.com
记住:我没有使用过 jQuery。它的纯 CSS。
【问题讨论】:
标签: css performance animation opacity css-transitions
我想减慢 .opacity CSS 属性中的动画时间。 就像,我希望它延迟 0.2 毫秒或类似的东西。
为了更好地了解,当悬停在我的网站上的精选帖子时会添加不透明度:http://www.thetechnodaily.com
记住:我没有使用过 jQuery。它的纯 CSS。
【问题讨论】:
标签: css performance animation opacity css-transitions
您似乎在寻找的是CSS Transitions。
【讨论】:
【讨论】:
使用 jquery
$('#clickme').click(function() {
$('#book').animate({
opacity: 0.25,
left: '+=50',
height: 'toggle'
}, 5000, function() {
// Animation complete.
});
});
http://api.jquery.com/animate/
使用 css 你可以尝试这样的事情:
.class:hover {
opacity: 1;
-moz-transition: all 0.4s ease-out; /* FF4+ */
-o-transition: all 0.4s ease-out; /* Opera 10.5+ */
-webkit-transition: all 0.4s ease-out; /* Saf3.2+, Chrome */
-ms-transition: all 0.4s ease-out; /* IE10? */
transition: all 0.4s ease-out;
}
【讨论】: