$('.myclassname').mouseover(function(){
if($(this).children('span').css('font-weight')=='normal')
{..do something... }
}
为什么“做某事”在 Chrome 上有效,但在 Firefox 16 和 Internet Explorer 9 上无效? 如果我删除 if 条件,它会起作用,但我需要它,所以我无法删除。 这是CSS
div.myclassname span {...; font-weight:normal ; ...}
最佳答案
尝试,
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。
关于javascript - Jquery/Javascript 和 Css 条件不适用于 firefox 和 IE。它适用于 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13513769/