Click to See Complete Forum and Search --> : My javascript menu looks like it is "flashing"


lmbree
12-04-2003, 10:01 AM
I have a javascript menu with a sub menu and when you scroll over the values in the sub-menu the first time the menu appears to be flashing. I believe this is because as you scroll over, the menu is disappearing for a split second and i am seeing the white background of the page. Once you scroll over an item once, it no longer happens. Any ideas? I have no idea what lines to post to help...

ray326
12-04-2003, 11:17 AM
If this is an image-based menu then I'd suspect the images are loading with the first use and that causes the flash.

lmbree
12-04-2003, 11:29 AM
No, it isn't an image based menu, it is text... It doesn't make sense to me. Thanks for trying...

lmbree
12-04-2003, 03:50 PM
i comment these two functions out and the flashing stops... Am I doing something wrong in here? and the flashing only happens the first time scrolling over each menu.

function spanOver(spannum,whoimg)
{
<!--- clearTimeout(timeOutSet); --->

//parent.writeDebug("spanOver: "+spannum);
eval ( "document.all.span" + spannum + ".style.color='#highlightColor#'");

eval ( "document.all.span" + spannum + ".style.backgroundColor='#highlightBkgdColor#'");
eval ( "document.all.sublevel" + spannum + ".style.backgroundColor='#highlightBkgdColor#'");

if (whoimg == 1)
{
eval ( "document.all.rowimgover" + spannum + ".src='/se/editor/images/whitearrow.gif'" );
}

}

function spanOut(spannum,whoimg)
{
//parent.writeDebug("spanOut: "+spannum);

eval ( "document.all.span" + spannum +".style.color='#menuColor#'");

eval ( "document.all.span" + spannum +".style.backgroundColor='#menuBkgd#'");

eval ( "document.all.sublevel" + spannum +".style.backgroundColor='#menuBkgd#'" );


if (whoimg == 1)
{
eval ( "document.all.rowimgover" + spannum + ".src='/se/editor/images/Arrow.gif'" );
}
}

Pittimann
12-04-2003, 03:57 PM
Hi!

OK - the menu itself might be text based.
Didn't read all, but what is that:
--------
eval ( "document.all.rowimgover" + spannum + ".src='/se/editor/images/Arrow.gif'" );
--------
the Arrow.gif is text??

I think, ray326's assumtion is applicable. If you preload these images, flashing will stop.

Cheers - Pit

lmbree
12-04-2003, 04:12 PM
the arrow is a graphic on one of the submenus, I took it out and the flashing still occurs... Any other ideas? I appreciate everyones help.

edelmatt
12-04-2003, 04:33 PM
what event handler are you using to call this "spanOver" function?

I think you're assumption about the menu quickly turning on/off because of the function getting called over and over quickly is correct.

lmbree
12-04-2003, 04:41 PM
I'm using onmouseout and onmouseover. So it is mousing out of one and over another. I am confused because it only happens the first time you scroll over a submenu... after you scroll over each of the items in the same submenu it doesn't do it in that submenu. if you leave that submenu and come back it does it again.