1

我有一个包含列表的 div。

它的CSS:

#ResultsText  
{  
  color: #696969;
  text-align: right;
  vertical-align: top;
}

在 JS 文件中:

$("li.ResultParagraph").mouseover(function () {
  $(this).addClass("ui-state-hover");
}).mouseout(function () {
  $(this).removeClass("ui-state-hover");
});

$('.ui-state-hover').css("font-weight", "normal");

但我仍然看到粗体的悬停文本。
有什么建议么?

4

1 回答 1

3

你应该这样做(或用“正常”切换“粗体” )

$("li.ResultParagraph").mouseover(function () {
    $(this).addClass("ui-state-hover").css("font-weight", "bold");
}).mouseout(function () {
    $(this).removeClass("ui-state-hover").css("font-weight", "normal");
});

演示

于 2012-05-17T08:56:46.427 回答