开发者

Browser detection and addClass

This doesn't work

if( $.browser.opera ){
    $("body"开发者_如何学运维).addClass('opera');
}

why?


Have you tried

if( $.browser.opera ){
    $("body").attr("class", "opera");
}


There is no problem using addClass. When opera loads there is no 'opera' class in body when I view sourcecode, but when I add in CSS body.opera{display:none;} it's executed. So problem is in browser. Browser doesn't make jQuery changes in user visible source code of browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜