I would like to make a nice little text effect on my site where the text slowly fades in from white to black.
I found this code below but it just seems to do nothing. Also I would prefer not to use a java applet but rather Javascript or DHTML. Again the text should just fade in once and stop
going from white to black.
any ideas??
I found this code below but it just seems to do nothing. Also I would prefer not to use a java applet but rather Javascript or DHTML. Again the text should just fade in once and stop
going from white to black.
any ideas??
Code:
<script type="text/javascript">
hex=255 // Initial color value.
function onPageLoad(){
if(hex>0) { //If color is not black yet
hex-=11; // increase color darkness
document.getElementById("sample").style.color="rgb("+hex+","+hex+","+hex+")";
setTimeout("fadetext()",20);
}
else
hex=255 //reset hex value
}
</script>
<DIV id="sample" style="position:absolute; left:-05px; top:297px; font-family:verdana; font-size:14px; line-height:21px;" >
The payoff...<BR>better service for your<BR>customers and greater<BR>profits for you.</I></B>
</DIV>