iPhone Detect Zoom-帮助! [英] iPhone Detect Zoom - Help!

查看:123
本文介绍了iPhone Detect Zoom-帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这适用于我所有的测试浏览器:

This works in all my test browsers:

<body onresize="handleResize()">

 

// Aint perfect, but works well enough!
function handleResize()
{
    // Document.ready sets initialWidth = window.innerWidth;
    var zoomAmount = Math.round((initialWidth / window.innerWidth) * 100);
    $('#db').html(zoomAmount);
}

在iPhone上,当我用两根手指放大和缩小时,该数字不会更新.

On iPhone when I use two fingers to zoom in and out, this number is not updated.

iPhone用户缩放时如何触发事件?

How can I trigger an event when the iPhone user zooms?

推荐答案

您不能.当您缩放iPhone Web工具包时,实际上并没有按照调整浏览器窗口大小的方式来调整网页视图的大小-请注意,内容不会重排. iPhone所做的一切只是炸毁了整个网络内容的一部分.

You can't. When you pinch to zoom on the iPhone web kit, you're not actually resizing the view of the web page in the same sense as when you resize a browser window -- notice that the content doesn't reflow. All the iPhone is doing is blowing up a certain section of the complete web content.

这篇关于iPhone Detect Zoom-帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆