用jquery删除css:hover属性

让我说
<style>
    #container:hover{background:red}
</style>
<div id="container"><input type="submit"></div>

当我在提交时悬停,#container仍然是红色的.我可以删除那个:使用jquery将鼠标悬停在鼠标悬停上吗?我不想更改bg $(‘#container’)css(‘backgroundColor’,’color’),我需要像$(‘#container’)这样的东西removeAttr(‘hover’).

解决方法

不幸的是,使用jQuery管理CSS伪类是不可能的.

我建议你操纵课程,如下所示:

<style>
    .red:hover{background:red}
</style>

<div id="container" class="red"><input type="submit"></div>

<script>
    $("#container").removeClass("red");
</script>

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...