Nick payne
2005-Jun-29 07:26 UTC
[Rails-spinoffs] Effects flicker in firefox when called with setTimeout
Hi,
I have a page calling a fade effect from a setTimeout. In Firefox the
element flickers before fading. It works fine in IE - I haven''t
tested any others. Has anyone else noticed this?
I''ve included a simple prototype below (sorry haven''t got web
space to
post to - anyone know of any good free space?). Whilst in the
prototype it doesn''t to be much of an issue its more noticeable where
I''m using it. Is there anyway round this? Strangely it seems to be
fine if the element is floated.
Thanks,
Nick
<html>
<head>
<script language="javascript" type="text/javascript"
src="prototype-1.3.0.js"></script>
<script src="dragdrop.js"
type="text/javascript"></script>
<script language="javascript" type="text/javascript"
src="effects2.js"></script>
<script language="javascript" type="text/javascript">
function hide()
{
new Effect2.Fade("box");
}
window.onload = function()
{
setTimeout("hide()",2000);
}
</script>
</head>
<body>
<div id="box" style="width: 300px; margin: 10px; padding:
30px;
border: 1px solid red; background: #000;">
<div style="background: #ccc; padding: 10px;"></div>
</div>
</body>
</html>
