WP8 IE10视口问题 [英] WP8 IE10 viewport issue

查看:142
本文介绍了WP8 IE10视口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人注意到,当使用-ms-viewport(指定宽度为320像素或设备宽度)时,网络浏览器内容可以移到可用空间之外?它似乎文件大小是错误的,所以我可以滚动它的内容到左边,但没有什么,然后是白色的空白空间。我也可以放大它(但我不应该),它的大小后并不总是相同的。我知道 http://mattstow.com/ responsive-design-in-ie10-on-windows-phone-8.html ,但它没有帮助。

Did any of you noticed that when using -ms-viewport (with specific width of 320px or device-width) then web browser content can be moved outside available space? It seems like document size is wrong so i can scroll it's content to the left but there is nothing then white empty space. I can also zoom it out(but i should not) and it's size after that is not always the same. I'm aware of http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html but it does not help. It happens after second or third navigate to the same content and disappears for example when device is rotated.

推荐答案

Windows Phone 8不支援这项功能正确识别webkit和移动网络标准的 meta viewport 标记。

Windows Phone 8 does not properly recognize the meta viewport tag that is standard for webkit and mobile web.

p>

Try this in your CSS

@-ms-viewport{width:device-width}

然后添加这个JS

if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
    var msViewportStyle = document.createElement("style");
    msViewportStyle.appendChild(
        document.createTextNode(
            "@-ms-viewport{width:auto!important}"
        )
    );
    document.getElementsByTagName("head")[0].
        appendChild(msViewportStyle);
}

更多此处(信用)

这篇关于WP8 IE10视口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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