P
Prisoner at War
Another weekend, another project, another problem....
Why should a perfectly fine function work only half-way through when
called through onClick in an anchor tag??
The text fade-in script below works when called through onLoad in the
<body> tag, but it "hangs" when called through onClick in <a
href="#">, as follows:
<script language="JavaScript1.2">
var hex=240;
function FadePage()
{
if (hex>0)
{
hex-=11;
document.getElementById("text").style.color="rgb("+hex+","+hex
+","+hex+")";
setTimeout("FadeText()",20);
}
else
{
hex=240;
}
}
</script>
I have a <div> with an id of "text"...again, it all fades in fine when
called through onLoad in the <body> tag but seems to stall at
setTimeout(...) -- maybe it doesn't even get to it at all; the text
just fades in half-way and stays that way, never completing the fade-
in process.
Now why should that be??
TIA!!
Why should a perfectly fine function work only half-way through when
called through onClick in an anchor tag??
The text fade-in script below works when called through onLoad in the
<body> tag, but it "hangs" when called through onClick in <a
href="#">, as follows:
<script language="JavaScript1.2">
var hex=240;
function FadePage()
{
if (hex>0)
{
hex-=11;
document.getElementById("text").style.color="rgb("+hex+","+hex
+","+hex+")";
setTimeout("FadeText()",20);
}
else
{
hex=240;
}
}
</script>
I have a <div> with an id of "text"...again, it all fades in fine when
called through onLoad in the <body> tag but seems to stall at
setTimeout(...) -- maybe it doesn't even get to it at all; the text
just fades in half-way and stays that way, never completing the fade-
in process.
Now why should that be??
TIA!!