Joh*_*ier -7 javascript css jquery
这有效:
$('div.hg_logo').hover(
function(){$(this).animate({
backgroundColor: 'rgba(31, 197, 78, 0.75)'
}, 1200)},
function(){$(this).animate({
backgroundColor: 'white'
}, 1200)}
);
Run Code Online (Sandbox Code Playgroud)
但鉴于我对CSS和JS的了解,它不应该!
1'rgba(31,197,78,0.75)'不应该引用.
2 backgroundColor应为背景色.
3颜色后应使用分号.
在以"this"为目标的内部功能之后,应使用4个分号.
根据我的理解,上面的四点是正确的CSS和JS - 但它们中的任何一个都会破坏这段代码.
这是$().animate的怪癖,还有机会改变吗?或者我应该承诺死记硬背?
#foo { color: white }在CSS中是完全合法的.\n).