I don't see any fading either in any browser...
EDIT: correction... after closing opening many times, I indeed see some "fading", but it is extremely fast, hence it is almost just popping up/away in 1 go... This is maybe also the reason for the flickering you see? Too fast fading?
If the delay in
setTimeout("fadeOutMenu()",10) is set to 100, you can see it fading. Maybe you tested it at a slow PC which can't handle 10ms and realy does it in 100ms? Experiment with higher values and see if the menu hides as fast. If it does then use the higher value rather then the lower value. As fast PC's can handle those lower values, the speed will not be the same on both PC's... If you know what I mean....
On my PC a value of 30 to 40 gives a nice result... (P4 2.66Mhz)
quote:
Originally posted by lopardo
BTW, I noticed that it flickers in Mozilla Firefox , anyone else? The weird thing is that, if I put an alert in the loop, it works fine...
yes, well, it doesn't flicker each time. Only the first time
menu.style.MozOpacity is set, the menu flickers off/on once... I dunno why, but after some tests (not in the loop, but outside the loop), it seems that is has something todo with the focus I assume... I changed the script to this to test:
code:
function hideMenu(UseFade){
if (MenuInitialized) {
if (UseFade && (isMSIE || isMozilla)) {
t = 1000
setTimeout("menu.style.MozOpacity = 1",t);
setTimeout("menu.style.MozOpacity = .9",t+100);
setTimeout("menu.style.MozOpacity = .8",t+200);
setTimeout("menu.style.MozOpacity = .7",t+300);
setTimeout("menu.style.MozOpacity = .6",t+400);
setTimeout("menu.style.MozOpacity = .5",t+500);
setTimeout("menu.style.MozOpacity = .4",t+600);
setTimeout("menu.style.MozOpacity = .3",t+700);
setTimeout("menu.style.MozOpacity = .2",t+800);
setTimeout("menu.style.MozOpacity = .1",t+900);
setTimeout("menu.style.MozOpacity = .0",t+1000);
// set the focus to something else, a box
alert('boo');
//fadeOutMenu();
}
else {
menu.hide();
}
}
}
now, there isn't a flicker at the start... But dodgy enough, if you set t=2000, the flicker returns....