Remove ':hover' CSS behavior from element

后端 未结 6 1422
别那么骄傲
别那么骄傲 2020-11-29 16:57

I have CSS that changes formatting when you hover over an element.

HTML:

blah

CSS:

6条回答
  •  感情败类
    2020-11-29 18:02

    You want to keep the selector, so adding/removing it won't work. Instead of writing a hard and fast CSS selectors (or two), perhaps you can just use the original selector to apply new CSS rule to that element based on some criterion:

    $(".test").hover(
      if(some evaluation) {
        $(this).css('border':0);
      }
    );
    

提交回复
热议问题