Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
646 views
in Technique[技术] by (71.8m points)

html - Disable all page-zooming in IE11 on Windows8-Arm

How can I disable ALL viewport zooming for a webpage accessed via IE11 on WinRT?

I'm working on an application that does it's own drawing on a canvas sized to fit the viewport, and provides it's own zoom functionality internally. Having the browser zoom then makes a mess of the canvas.

I've been going through existing answers, and none of them seem to work for this plaform:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
or
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
or
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
or
<meta name="viewport" content="user-scalable=no" />
or
<meta name="viewport" content="width=device-width" />

In the <header> all have no effect.

Additionally, I'd like to block double-tap-zooming, but the various jQuery snippets I've seen don't seem to work here either.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Arrrgh, so as soon as I asked the question, I found a solution:

Adding:

html
{
    -ms-content-zooming: none; /* Disables zooming */
    touch-action: none;   /* Disable any special actions on tap/touch */
}

to the CSS for the application page appears to properly block pinch-zoom in IE, and disable any of the special actions triggered by tapping/double-tapping.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...