JQuery detects if browser supports Zoom

How to check if browser supports Zoom css attribute? I know from Caniuse.com that only Firefoz does not support it, so from this question ( In Javascript, how to determine if my current Firefox browser is on the computer and not on everything else? ) I tried:

if ($.browser.mozilla) { ... 

which returns me an error in chrome:

Cannot read property 'mozilla' of undefined

Another solution according to the answer detects if the browser supports this function, how can I do this?

+4
source share
2 answers

Here's how you can find CSS function support in plain JavaScript. (Replace scaling with any function.)

document.createElement("detect").style.zoom === ""
+5

, : jquery , css

- JS, CSS , , Modernizr.

+2

All Articles