PDA

View Full Version : Image/Hyperlink Fade-In



grobend
14 May 2011, 08:27 PM
Hi, I've been using the following code to give the text a fade-in effect when the page loads. Unfortunately, this code only works for texts. I want the same effect for hyperlinks and images. What do I need to do?


<html>
<head>
<script language="javascript">
col=255;
function fade() { document.getElementById("fade").style.color="rgb(" + col + "," + col + "," + col + ")"; col-=5; if(col>0) setTimeout('fade()', 10); }
</script>
</head>

<body onLoad="fade()">

<p>
<span id="fade">Fading text</span>
</p>

</body></html>

cadenuo
14 May 2011, 10:20 PM
do a google search for some simple jquery code that will be a very easy one to make up