// 解决Internet Explorer 10 并没有对 屏幕的宽度 和 视口(viewport)的宽度 进行区分 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle = document.createElement('style') msViewportStyle.appendChild( document.createTextNode( '@-ms-viewport{width:auto!important}' ) ) document.querySelector('head').appendChild(msViewportStyle) }