Windows 7(而不是 XP)上的 Firefox 5 DOM 错误?

发布于 2024-11-27 23:32:36 字数 552 浏览 4 评论 0原文

我有一个由两个 div 组成的表格,一个上部和一个下部。下部 div 是可滚动的,当您滚动时,上部 div 会随之滚动(因此您可以看到列)。在 Windows XP、FF 5 上它工作正常,但在 FF 5、Win 7 上,当我滚动时,下部 div 中的数据有时会出现在顶部 div 中(包含列标题)。

它通常发生在我将滚动条一直拖动到左端或右端之后。另外,几秒钟后,顶部 div 变回列标题(它本来应该是这样)。

这是我用于滚动的 javascript:

function Scroll(SourceID, TargetID, DoIfMoz){
    if(DoIfMoz || navigator.userAgent.indexOf("Firefox") == -1) document.getElementById(TargetID).scrollLeft = document.getElementById(SourceID).scrollLeft;
}

其中 SourceID 是下部 div,TargetID 是正在移动的上部 div。

有谁知道发生了什么事?

I have a table which consists of two divs, an upper and a lower. The lower div is scrollable and as you scroll, the upper div keeps up with this (so you can see the columns). On windows XP, FF 5 it works fine, but on FF 5, Win 7 when I scroll across sometimes the data in the lower div appears within the top div (containing the column headers).

It usually happens after i drag the scrollbar all the way to the left or right extreme. Also, after a few seconds the top div changes back to the column headers (what it should have been all along).

This is my javascript for the scrolling:

function Scroll(SourceID, TargetID, DoIfMoz){
    if(DoIfMoz || navigator.userAgent.indexOf("Firefox") == -1) document.getElementById(TargetID).scrollLeft = document.getElementById(SourceID).scrollLeft;
}

where SourceID is the lower div and TargetID is the upper div, which is being moved.

Does anyone know what's happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

◇流星雨 2024-12-04 23:32:36

您发布的代码中没有任何内容会更改屏幕上任何元素的内容。正如你所说,几秒钟后它确实会变回原来的样子,我更认为这是浏览器渲染整个页面的方式中的一个小故障。您是否尝试过为左/右滚动设置一个停止点,例如,如果我们可以向左滚动的最大距离是 100 像素,那么它会在 99 像素处停止滚动(您确实说过,当您将滚动条一直拖动到左/右

There is nothing in the code that you posted that would be changing the content of any element on the screen. As you say it does change back to what it is meant to be after a few seconds I would be more thinking this is a glitch in the way the browser is rending the overall page. Have you tryed setting up a stop for the scroll left/right, so for example if the max scroll we can do left is 100px have it stop scrolling on 99px (you did say it kicks in when you drag the scroll bar all the way to the left/right

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文