Hi, I have three links on the home page of the website I'm developing that I want to fade in on page load. I've found numerous scripts on the web to do this, but I can't seem to get any of them to work. I'm fairly proficient with HTML code, but...
Hi, I have three links on the home page of the website I'm developing that I want to fade in on page load. I've found numerous scripts on the web to do this, but I can't seem to get any of them to work. I'm fairly proficient with HTML code, but near clueless when it comes to Javascript, CSS, etc. I'd greatly prefer a short script that doesn't require any external files. I finally found a script for blinking text that I thought I could edit to just cycle through once, so what I have is the text "blinking" from shades ranging from white to dark gray (the final color I want the text to be), giving the illusion that the text links are fading in. However, the script I found repeatedly cycles through all the colors, but I just want it to go through once and stop. If anyone could help me edit it to do this, I'd very much appreciate your help. Thank you!
Code:
function initArray() { for (var i = 0; i < initArray.arguments.length; i++) { this[i] = initArray.arguments[i]; } this.length = initArray.arguments.length; }
var colors = new initArray( "#FFFFFF","#DDDDDD","#CCCCCC","#BBBBBB","#AAAAAA", "#999999","#888888","#777777","#666666","#555555") ;
delay = .1;
link = 0;
vlink = 0;
function FadeIn() { link = (link+1)%colors.length; vlink = (vlink+1)%colors.length; document.linkColor = colors[link]; document.vlinkColor = colors[vlink]; setTimeout("FadeIn()",delay*1000); }
FadeIn();