1

我对 ipod safari 上的 iframe 行为感到困惑。我编写了一个示例 html 页面“index.html”并添加了 touchstart/touchmove/touchend 事件。我在 ipod safari 上试了一下。

使用双击放大内容页面并显示不同的 document.body.clientWidth 和 document.body.clientHeight。

我写了另一个页面“iframe.html”,包括 iframe。我尝试并按比例放大,但显示相同的 document.body.clientWidth/document.body.clientHeight?我不知道这个问题。如果您有任何想法,请与我分享您的想法。谢谢。

“iframe.html”的内容:

<iframe src="index.html" id="mainFrame"> </iframe>

“index.html”的内容:

var targetToucheSize = 0; 
function handleStart(evt) { ... } 
function handleMove(evt) { ... }
function handleEnd(evt) { 
    var winW; 
    var winH; 
    if (targetToucheSize == 2) {
        if (!document.all) { 
            winW = window.innerWidth; 
            winH = window.innerHeight;
        } else { 
            winW = document.body.clientWidth; 
            winH = document.body.clientHeight; 
        } 
        alert(" winW " + winW + " winH " + winH); 
    } 
}
4

0 回答 0