8
是否可以(使用jQuery或其他方式)将某个元素的样式设置为样式表中定义的:hover
样式?使用jQuery将元素样式设置为:悬停样式
.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'可能需要'mouseover' – 2014-09-18 21:25:09