是否可以使用jQuery或其他方法将某个元素的样式设置为样式表中定义的:hover
样式?
.regStyle {
background-color: #000;
}
.regStyle:hover {
background-color: #fff;
}
Trying it out
$("#differentButton").click(function(){
// this doesn't work
$("#someElement").addClass("regStyle:hover").remove("regStyle");
});
mouseOver
might need to bemouseover
- Kevin Reilly