Detect firefox browser with jquery

前端 未结 4 1556
臣服心动
臣服心动 2021-02-13 11:14

I facing a problem is my css is have a some bug when firefox is lower than 2.0. I would like to detect the browser to fix my css bug.

This is my code:

$(         


        
4条回答
  •  梦毁少年i
    2021-02-13 12:06

    I just bumped into this problem myself. $.browser.version actually detects the version of the rendering engine, and not the version of the browser (despite what its name implies), so if you want to detect Firefox 4 and later, you should use

    $.browser.mozilla && $.browser.version > '2'
    

    Because Firefox 4 uses Gecko 2.0 as the rendering engine. It's rather confusing, I know :)

提交回复
热议问题