jquery - 屏幕高度超过 768px 的元素错误

标签 jquery html css

我已将 psd 着陆页编码为 html5/css3 并使其适合 ipad 和移动设备,但存在问题 当我尝试在高度超过 768px 的屏幕上浏览它时,元素变小并显示在半页中,另一半是空的! 直播网址:http://idealogy-creative.com/1/ 问题的屏幕截图 https://www.browserstack.com/screenshots/c7f2884acf1102cc3536c1c5b8b62208ff8a8c92/win8.1_ie_11.0_Desktop.jpg

请帮帮我!

最佳答案

我有同样的问题,我改变了一些小的东西来解决这个问题,也许是视口(viewport)?先尝试设置视口(viewport),然后告诉我,我会检查我的网站。

P.S 对于 Windows Phone 你必须设置一些更多的东西: 1. CSS

@-webkit-viewport { width: device-width; }
@-moz-viewport { width: device-width; }
@-ms-viewport { width: device-width; }
@-o-viewport { width: device-width; }
@viewport { width: device-width; }
  1. 脚本:

    //针对 windows phone 的修复

    if (navigator.userAgent.match(/IEMobile/10.0/) || navigator.userAgent.match(/IEMobile/11.0/) || navigator.userAgent.match(/WPDesktop/)) {

    var msViewportStyle = document.createElement("style");
    msViewportStyle.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}"));
    document.getElementsByTagName("head")[0].appendChild(msViewportStyle);
    

关于jquery - 屏幕高度超过 768px 的元素错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26809526/

相关文章:

javascript - 以正确的方式使用 z-index

css - H2 margin-top 与其 Section 标签冲突

css - Chrome (webkit ?) rotateX 使光标不改变

html - 后代选择器用法

javascript - 将两个事件处理合并为一个事件处理

javascript - json 到 javascript - 谷歌图表

javascript - 使iframe根据内容自动调整高度而不使用滚动条?

html - 从 0.9.2 更新到 0.9.5 后出现错误 "java.lang.IllegalArgumentException: Illegal group reference"

javascript - 键盘事件 :Moving div to left with margin-left on pressing key

javascript - KnockoutJs 中 UI 刷新后是否有回调?