Disable all page-zooming in IE11 on Windows8-Arm

↘锁芯ラ 提交于 2019-12-18 05:55:06

问题


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.


回答1:


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.




回答2:


use this

var zoomlevel=1;

    $("body").dblclick(function(ev) {
        zoomlevel = zoomlevel == 1 ? 2 : 1;



        $(this).css({
            "-moz-transform":"scale("+zoomlevel+")",
            "-webkit-transform":"scale("+zoomlevel+")",
            "-o-transform":"scale("+zoomlevel+")",
            "-ms-transform":"scale("+zoomlevel+")"
        });


    });


来源:https://stackoverflow.com/questions/23757403/disable-all-page-zooming-in-ie11-on-windows8-arm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!