...

View Full Version : auto change BG



rafiki
05-06-2007, 11:53 AM
is there a way to automatically fade change the colour of a BG every15 seconds? i know its done onclick but dont know how on a set interval
thanks

antimatter15
05-06-2007, 03:02 PM
is there a way to automatically fade change the colour of a BG every15 seconds? i know its done onclick but dont know how on a set interval
thanks
i originally made this to give people seizures....
but with some changes, it can do that, but fading would be complicated

<script>
var interval = 15 ; //set the interval in seconds
var a=new Array(); //create an array for the colors
var i=1;//to keep track on the current color
a[1]='red';//first color
a[2]='blue';//second color
a[3]='green';//third color
function c(){
document.bgColor=a[i];
i++;
if(i>3){
i=1
}
setTimeout('c()',interval*1000)
}
c();
</script>

rafiki
05-06-2007, 03:09 PM
thanks ill take a look, i take it it goes in <head> tags?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum