开发者

Browser detection and addClass

开发者 https://www.devze.com 2022-12-18 11:51 出处:网络
This doesn\'t work if( $.browser.opera ){ $(\"body\"开发者_如何学运维).addClass(\'opera\'); } why?Have you tried

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

精彩评论

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

关注公众号