function allowscroll()
{
if (screen.width<1200){document.getElementById('html').style.cssText='overflow-x: scroll !important;';};
}
<body onLoad="allowscroll();">
您好,上面的代码适用于任何元素,例如将“html”替换为“wrapper”,但是如何编辑应用于 html 的 css?基本上,由于溢出:隐藏在 ie7 中没有继承 - 这会导致右侧空白和水平滚动条很大(仅在 ie7 中,即 8 兼容),我将 css 设置为
html {overflow-x:hidden;}
这是在不丢失必要功能的情况下修复它的唯一方法,例如溢出的图形可见性。
这一切都很好,但是,较低的屏幕分辨率需要水平滚动才能看到所有页面本身,所以我正在尝试为这些用户恢复水平滚动条 - 并为发生的任何人恢复大右边距例如 ie7 1024 by 768 - 我可以忍受(除非有人碰巧有一个 superdupa 解决方案)。
document.getElementById('html').style.cssText='overflow-x: scroll !important;';
因此,上面的代码适用于编辑任何元素的 CSS,但不适用于 html 的 CSS。
我也试过:
function allowscroll()
{
if (screen.width<1200){document.getElementByName('html').style.cssText='overflow-x: scroll !important;';};
}
和
function allowscroll()
{
if (screen.width<1200){window.style.cssText='overflow-x: scroll !important;';};
}
我真的很感激任何帮助, - 如果它有助于查看解决方案,则适用的链接是:喜悦设计,基本上,它是如何取出的:
html {overflow-x:hidden;}
在较低的屏幕分辨率下从css...
非常感谢
将要