开发者

Using jquery.support to check for Firefox 3.5

开发者 https://www.devze.com 2022-12-15 06:16 出处:网络
I\'d like to use some CSS that is only supported by Firefox 3.5 at the moment (box-shadow: inset). For all the other browsers, via jQuery, I\'ll have to insert some extra divs with backgrounds to acco

I'd like to use some CSS that is only supported by Firefox 3.5 at the moment (box-shadow: inset). For all the other browsers, via jQuery, I'll have to insert some extra divs with backgrounds to accomplish the effect.

I'd like to 'reward' FF3.5 users and not bother with that bit of script if they support the CSS开发者_如何学运维.

It seems that the 'proper' way to test for a browser via jQuery is to use jQuery.support. However, I don't see/know of any particular feature I could test for that would be unique to Firefox 3.5. Is there such a thing?

Barring that, should I just drop back and use jQuery.browser to get the rendering engine version number as shown here:

Why does JQuery.browser.version return 1.9.1.2 for Firefox 3.5.2

ADDENDUM: I do know there are browser detect plugins for jQuery. If one is really, really great, I'd consider it, but feel that loading a plugin to avoid running an extra few functions in FF3.5 probably defeats the purpose.


This works in Firefox 3.5 for me. It is specific to Firefox (or rather, the Gecko rendering engine).

if (typeof document.body.style.MozBoxShadow === 'string') {
// Do something
}
0

精彩评论

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

关注公众号