【发布时间】:2012-09-13 16:24:13
【问题描述】:
我正在尝试同时为元素的不透明度和背景颜色设置动画。我正在使用下面的代码,但目前只有不透明度动画。
$("div.offer").mouseover(function() {
var myClass = $(this).attr("class");
$(this).stop().animate({width:'259px'}, {queue:false, duration:600, easing:'easeOutQuint'});
if (myClass == "offer windows") {
$(".offer.windows .offerBackground").stop().animate({opacity:'1'}, {queue:false, duration:600, easing:'easeOutQuint'});
$(".offer.windows .offerBackground").stop().animate({backgroundColor:'#B0C1C8'}, {queue:false, duration:600, easing:'linear'});
}
});
是否可以同时为两者制作动画?
【问题讨论】:
-
您需要 jQueryUI 来为颜色设置动画:?.. 或者您可以使用 CSS 轻松完成这一切。
标签: jquery jquery-animate opacity background-color