9
我已经标记了使用此规则切换悬停css样式。当面板内有一个复选框时,我想删除背景图像样式。这可能吗?尽管失败,我已经尝试了以下内容。删除css悬停样式
CSS:
.StaffMode .day ul li.standard a:hover table {
background:url("test.png");
}
JS:
$("li.test table li").hover(
function() {
if($(this).children(':checked')) {
alert('need to remove the background image style'); // shows as expected
$(this).children('a').removeClass('hover'); // this doesnt work?
}
}
);
':hover'是一个伪类,不是JavaScript可以删除的真实类。 – KRyan
你可以发布你的HTML请或更好的jsFiddle – Chin
我做过小提琴,但它真的很复杂的标记,所以很难发布任何有意义的东西。 –