的CSS

#nextCh:hover{
    margin-right:6px;
}


在某些情况下,我想删除此:hover事件

像这样:

if (indexL == countL) {
    $("#nextCh").css(":hover", "remove");
}

最佳答案

像这样做:

#nextCh.withHover:hover {
   margin-right:6px;
}


然后将类withHover应用于#nextCh

要删除悬停效果,请删除类withHover

$("#nextCh").removeClass("withHover");

08-07 17:46