views:

1484

answers:

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!

A: 

To me IE (and Chrome) implements a REAL preemption. I mean IE litteraly stops what it's doing (other Javascript execution or internal code to render a page or fetch it or...) to immediately serve the javascript function.

Firefox, on the contrary, finishes what he's doing before serving the timer "interrupt". As a result, jitter happens. But function calls are not missing, is is still reliable.

it is also possible that only the display is frozen for an unclear reason in FF.

Eric http://codevault.agilityhoster.com