1

I have a horizontal scroll created in javascript that works in IE and Chrome, however I get a flicker in Firefox 2 and 3. The div that is moving contains an iframe with images and text with absolutely positioned divs. (see code below.)

Problems:

1) The content appearing in either the div to the left or the right of the animating div appears to flicker on the side where the style.left is moving "under" the adjacent divs. This occurs in Firefox only.

2) It seems that when using the mouseover handler for approximately 10 seconds (in Firefox only) the animation pauses for about a second, and then starts again. This does not occur in either IE or Chrome.

The javascript is:

<script type="text/javascript">
//outtake
function scrollframeleft() {
    var divmenuleft = getLeft("divMenu");
    var framewidth = parent.frames["framecontent"].scrollwidth;
    var scrollportal = 740;
    var scrollCatch = 13;

    if (!noScroll && divmenuleft <=scrollCatch) {
        divMenuObjStyle.left=(divmenuleft+scrollDistVar)+'px'
        t = setTimeout("scrollframeleft();",scrollSpeedVar)
    }
}
</script>

The HTML is:

<div id="divBg" style="position:absolute; z-index:10; top:415px; left:13px; width:740px; height:100px; clip:rect(0px 740px 102px 13px); visibility:visible;"> 
    <div id="divMenu" style="position:absolute; z-index:10; top:0px; left:13px; color:#FFFFFF; visibility:visible;">
        <iframe name="framecontent" id="framecontent" frameborder="0" 
        height="100" width="5000" scrolling="no"  src="/content.php">
        </iframe>
    </div>`
</div>
<div id="divArrowLeft" style="position:absolute; z-index:204; left: 136px; top:398px;">
    <a href="#" onmouseover="noScroll=false;scrollframeleft()"
    onmouseout="noMove()" onclick="void blur()"><img
    src="/images/leftarrow_sm.gif" width="14" height="14" alt="more news scroll left" border="0"></a>
</div>

Thanks for your support!

4

1 に答える 1

1

私にとって、IE(およびChrome)はREALプリエンプションを実装しています。つまり、IE は、実行していること (他の Javascript の実行、またはページをレンダリングするための内部コード、またはページを取得するための内部コードなど) を文字通り停止して、すぐに JavaScript 関数を提供します。

反対に、Firefox は、タイマーの「割り込み」を処理する前に、自分が行っていることを終了します。その結果、ジッターが発生します。しかし、関数呼び出しは欠落しておらず、依然として信頼性があります。

FFでは原因不明で表示だけがフリーズすることも考えられます。

エリック http://codevault.agilityhoster.com

于 2009-02-24T18:03:25.067 に答える