我得到了我想用萤火虫的效果;我禁用此:像使用萤火虫一样禁用使用jquery的css类,有可能吗?
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a {
color:#030303;
}
(其实我只需要禁用.ui-state-highlight a {color:#030303}
) 我怎么能做到这一点使用jQuery?
我得到了我想用萤火虫的效果;我禁用此:像使用萤火虫一样禁用使用jquery的css类,有可能吗?
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a {
color:#030303;
}
(其实我只需要禁用.ui-state-highlight a {color:#030303}
) 我怎么能做到这一点使用jQuery?
您可以覆盖使用JQuery css方法的风格,但可能是最清晰的解决方案是在本地建立自己的jQuery UI的样式表的版本,并改变它在必要时。
或者,如revaxarts指出,您可以使用!important
指令覆盖值。
嗯,我不确定我是否理解你的需求是正确的,但首先你需要选择你的元素,我假设你想在你的代码中将这个应用到每个<a>
。从一组的元素中移除一个类,你可以使用.removeClass()
$('a').removeClass('ui-state-highlight');
如果它只是需要删除您可以删除特定的CSS到位的颜色。
$('a').css('color', '#000');
试试这个,
$('.ui-state-highlight').removeClass('.ui-state-highlight');
我没有解释一切细节中存在,但我这样做解决了我的问题:$ ('.ui-state-highlight a').css('color',$('。ui-state-default').css('color')); – Omu 2010-09-30 07:51:51