3
$('.myclassname').mouseover(function(){

  if($(this).children('span').css('font-weight')=='normal')

  {..do something... }

}

Why the "do something" works on Chrome but not on Firefox 16 and Internet Explorer 9? If I delete the if condition it works, but I need it so I can't delete. Here's the css

div.myclassname span {...; font-weight:normal ; ...}
4

3 に答える 3

1

試す、

if($(this).children('span').css('font-weight')=='400')

また

if($(this).children('span').css('font-weight')==400)

ここで確認してくださいhttp://jsfiddle.net/muthkum/qpEK2/2/ font-weight JSで400を返します。

于 2012-11-22T13:39:49.520 に答える
0

これを試して:

if($(this).children('span').eq(0).css('font-weight')=='normal')
于 2012-11-22T13:31:16.657 に答える
0

jsfiddleで設定できますか?行う:

$('.myclassname').mouseover(function(){
    $('span',$(this)).each(function(){
      if($(this).css('font-weight')=='normal'){
       //do something
      }
    });
});

仕事?

于 2012-11-22T13:37:45.307 に答える