IE 10 Windows Phone响应重定向循环

时间:2014-07-07 11:08:00

标签: windows-phone-8 responsive-design internet-explorer-10

我已经使用Twitter Bootstrap来响应我的网络stie和我的手机Lumia 920它无法正常工作。我在JavaScript中找到了一个解决方案:

(function() {
    if ("-ms-user-select" in document.documentElement.style && 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);
    }
})();

但我在我的电脑上有重定向循环(此脚本应仅在IE 10移动设备中运行)。问题在于:

document.createTextNode("@-ms-viewport{width:auto!important}")

因为如果我评论这一行,一切正常,但......在IE移动设备上响应。 我在我的CSS中添加了:

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

0 个答案:

没有答案