Is it possible to detect an zoom in / out event in iOS Safari?

We need to do something before the webpage is enlarged or disabled in Safari on iOS. Is it possible?

There are two cases where the interface scales - when the user performs a zoom gesture and when the user clicks on an input element. Although at first one could detect by listening to a gesture event (perhaps), what about the second?

And how do you know if a page is scaled?

+5
source share
1 answer

When you zoom in, window.innerWidth is set, but document.documentElement.clientWidth is not, therefore:

zoom = document.documentElement.clientWidth / window.innerWidth;
+1
source

All Articles