我有这个CSS规则:
#panelSeparator .active {
background: #fff url(../img/vgrabber.gif) no-repeat center;
opacity: 0.7;
}
Run Code Online (Sandbox Code Playgroud)
我想在JS中做这样的事情:
$('#panelSeparator').addClass('active');
Run Code Online (Sandbox Code Playgroud)
我应该如何更改addClass的参数才能使其工作?
谢谢,
丹
尝试删除#之间的空间,panelSeparator .active这样就可以了#panelSeparator.active.
| 归档时间: |
|
| 查看次数: |
116 次 |
| 最近记录: |