toy4fun
toy4fun

Reputation: 849

Overriding jquery ui after addClass

I have a div which contains a list.

Its CSS:

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

In the JS file:

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

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

but still I see the hover text in bold.
Any suggestions?

Upvotes: 1

Views: 272

Answers (1)

Eugene Trofimenko
Eugene Trofimenko

Reputation: 1631

You should do like this(or switch "bold" with "normal")

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

DEMO

Upvotes: 3

Related Questions