Override a:hover with jQuery?

后端 未结 4 786
庸人自扰
庸人自扰 2021-01-02 04:21
4条回答
  •  温柔的废话
    2021-01-02 04:42

    The easiest way would be to create a new CSS rule for the specific a tag. Something like

    a.linkclass:hover {color:samecolor}
    

    If you have to use JQuery to override the default styles, you have to manually add the css rules in the hover state, something like this:

    $('a.linkclass').hover(function(){
        $(this).css({'color':'samecolor'});
    });
    

    hope this help

提交回复
热议问题