jQuery使用css:hover更改颜色

jQuery使用css:hover更改颜色,jquery,css,css-transitions,Jquery,Css,Css Transitions,我有以下CSS #button:hover .inner { background-color: #9c0000; -webkit-animation: circle 1s; -webkit-animation-fill-mode: forwards; -moz-animation: circle 1s; -moz-animation-fill-mode: forwards; animation: circle 1s; animation-

我有以下CSS

#button:hover .inner {
    background-color: #9c0000;
    -webkit-animation: circle 1s;
    -webkit-animation-fill-mode: forwards;
    -moz-animation: circle 1s;
    -moz-animation-fill-mode: forwards;
    animation: circle 1s;
    animation-fill-mode: forwards;
}
其思想是,
.internal
将在父div中增长以填充它。这部分工作正常,但我希望允许人们定义
背景色
,当我尝试
$('#按钮:hover.inner').css('background-color',colorChoice')这根本不会改变它

所以我想知道,如果我能够提供一个变量,比如
var colorChoice='#ff0',是否可以使用jQuery从上面的css更改
背景色


我提供了我的示例来向您展示我希望它如何工作

使用jQuery应该是可行的,但我认为您需要使用与当前使用的$('#button:hover.inner')选择器相反的选择器。

文档没有提到这一点,但jQuery迁移插件说,
'hover'伪事件已被弃用,使用“mouseenter mouseleave”
$('#button').hover(function(){
    $(this).find('.inner').css('background-color',colorChoice);
});