【问题标题】:Chrome vs Firefox vs IE - Scrolling IssueChrome vs Firefox vs IE - 滚动问题
【发布时间】:2012-07-04 14:59:14
【问题描述】:
我正在开发一个网站,但它在 Chrome 中的行为似乎有所不同。滚动不一致或不流畅。它继续停止。但是,当我在 Firefox 或 IE9 中加载相同的站点时,我没有问题。一切都顺利滚动。
++++++++编辑++++++++
我可以通过将以下元标记添加到我的模板来解决我的问题:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
我不知道为什么,但它似乎解决了它......以及我遇到的其他问题
【问题讨论】:
标签:
internet-explorer
firefox
google-chrome
browser
【解决方案1】:
这是 Chrome 中的一个已知问题,我的解决方案在逻辑上并不清晰。这与 chrome 如何呈现 javascript 有关。但是,在将父容器 div 添加到滚动内容时,它似乎工作正常。在下面的链接中,javascript中有一个解决此问题的方法,并附有示例
Stackoverflow solution
对于您添加到网页的链接,它更多地与 IE 相关,而不是 chrome。你在 IE 中安装了 chrome 框架吗?
我不知道您使用的技术,但下面的代码会提示解决方案。在 Gwt(Google 网络工具包)中,我制定了如下解决方案:
导致问题的早期代码如下
旧代码:
<g:FocusPanel addStyleNames="{style.scrollable} {style.fullHeight}" ui:field="bodyContainer">
<b:CellTable width="100%" ui:field="bodyTable"/>
</g:FocusPanel>
新代码:
CSS:
#scrollContainer {
overflow:auto;
position:absolute;
top:0px; height:100%; width:100%;
}
HTML:
<div id="scrollContainer">
<g:FocusPanel ui:field="bodyContainer">
<b:CellTable width="100%" ui:field="bodyTable"/>
</g:FocusPanel>
</div>
希望这会有所帮助!