简体   繁体   English

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

[英]Firefox 5 DOM bug on windows 7 (and not XP)?

I have a table which consists of two divs, an upper and a lower. 我有一个表,其中包含两个div,一个上层和一个下层。 The lower div is scrollable and as you scroll, the upper div keeps up with this (so you can see the columns). 较低的div是可滚动的,并且随着您的滚动,较高的div保持同步(以便您可以看到列)。 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). 在Windows XP,FF 5上可以正常工作,但在FF 5,Win 7上,当我滚动浏览时,有时下div中的数据会出现在上div(包含列标题)中。

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). 同样,几秒钟后,顶部div变回列标题(应该一直保持不变)。

This is my javascript for the scrolling: 这是我用于滚动的JavaScript:

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. 其中SourceID是较低的div,TargetID是较高的div,正在移动。

Does anyone know what's happening? 有人知道发生了什么吗?

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 您是否尝试过设置向左/向右滚动的停止位置,例如,如果我们可以向左滚动的最大滚动速度为100px,则它会停止以99px滚动(您确实说过将滚动条一直拖动到左/右

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM