Link rotating images in existing javascript -
its been while since i've dug heals js , use help. looking modify existing script include link each rotating image... want link object called "text" same url each image. ideas?
//cur_index = 1; cur_index = math.floor(math.random()*6); //var randomnumber=math.floor(math.random()*11) num_image = 5; //alert(cur_index); interval = 300000; // 5min between rotations function rotate(){ // if(cur_index > num_image) // cur_index = 1; if(cur_index == 0) cur_index = 1; var imag,text; if(document.getelementbyid){ imag = document.getelementbyid("faceimage"); text = document.getelementbyid("facetext"); }else if(document.all) { imag = document.all["faceimage"]; text = document.all["facetext"]; }else if(document.layers){ imag = document.layers["faceimage"]; text = document.layers["facetext"]; } var imageurl = "/path/face" + cur_index + ".jpg"; var texturl = "/path/face" + cur_index + "_text.gif"; imag.src = imageurl; text.src = texturl; //cur_index++; cur_index = math.floor(math.random()*6); settimeout('rotate()',interval); }
Comments
Post a Comment