简体   繁体   English

在Android上检测Firefox中的捏缩放

[英]Detecting pinch-zoom in firefox on android

In the other Android browsers (Chrome and the default-one) pinch-zoom fires window.resize 在其他Android浏览器(Chrome和默认的一个)中,pinz-zoom会触发window.resize
- Not so in Firefox : ( -在Firefox中不是这样的:(
So how do I detect it (surely it can't be impossible) ? 因此,我该如何检测(肯定不是不可能的)?

Solution: I inserted a (hidden) div with width:100%. 解决方案:我插入了一个(隐藏的)div,其宽度为100%。
And a function that regularly monitors this div's width. 并有一个功能定期监视此div的宽度。
- When the width in pixels changes, zoom has changed - 以像素为单位的宽度变化时,缩放比例也发生了变化
(or orientation or screen size.. whatever): call myResize(). (或方向或屏幕尺寸。等等):调用myResize()。
Demo: http://krydster.dk - Crossword puzzle game (danish). 演示: http : //krydster.dk-填字游戏(丹麦语)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM