如何禁用窗口手机上的缩放8

时间:2014-05-05 13:52:41

标签: html css windows-phone-8 zoom

我有一个简单的页面,可以通过窗口手机放大,但我想锁定缩放。任何帮助我如何防止网页缩放窗口手机8

这是代码

<html>
<head>
    <meta name="viewport" content="width=device-width, user-scalable=no" />
    <title>HI there</title>
    <script type="text/javascript" src="jquery.js" ></script>


</head>



<body>
    <div style="width:100%; height:100px; background:red;">
        hi this is just the sample
    </div>
</body>


</html>

2 个答案:

答案 0 :(得分:1)

<head>

    <title>HI there</title>
    <script type="text/javascript" src="jquery.js" ></script>
<!-- add the viewport tag -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <style>
/* not needed      @-ms-viewport{
    width: device-width;
                   } */
    </style>


</head>

initial-scale=1, maximum-scale=1,添加到head

中的viewport标记

答案 1 :(得分:1)

您是否尝试将maximum-scale=1添加到该元标记中?有关详细信息,请参阅https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag