epiphany
05-06-2004, 11:05 PM
To Life Immortal
Hello. Glad to be here; I found you via Yahoo search. I just started learning vbScript
this week. I want to do fancy stuff on my website with DHTML. The script that I'm
working on is supposed to change background colour of webpage. It will gradually
fade to black.
Option Explicit
Dim kolor(6)
kolor(0)="ffffff"
kolor(1)="cccccc"
kolor(2)="999999"
kolor(3)="666666"
kolor(4)="333333"
kolor(5)="000000"
function fademe(x)
document.bgcolor=kolor(x)
end function
for w=0 to 5
call fademe(w)
next
The program works, but it is really fast. I need some way to place a 5 second timer in
the for....next loop. I tried the following, but it didn't work.
Option Explicit
Dim kolor(6)
kolor(0)="ffffff"
kolor(1)="cccccc"
kolor(2)="999999"
kolor(3)="666666"
kolor(4)="333333"
kolor(5)="000000"
function fademe(x)
document.bgcolor=kolor(x)
end function
for w=0 to 5
timer1=setTimer("fademe(w)", 5000)
timer1=clearTimer
next
Can someone tell me where I went wrong? Or is there another way to place a
5 second pause/wait between function calls? Thanks in advance for your help.
Hello. Glad to be here; I found you via Yahoo search. I just started learning vbScript
this week. I want to do fancy stuff on my website with DHTML. The script that I'm
working on is supposed to change background colour of webpage. It will gradually
fade to black.
Option Explicit
Dim kolor(6)
kolor(0)="ffffff"
kolor(1)="cccccc"
kolor(2)="999999"
kolor(3)="666666"
kolor(4)="333333"
kolor(5)="000000"
function fademe(x)
document.bgcolor=kolor(x)
end function
for w=0 to 5
call fademe(w)
next
The program works, but it is really fast. I need some way to place a 5 second timer in
the for....next loop. I tried the following, but it didn't work.
Option Explicit
Dim kolor(6)
kolor(0)="ffffff"
kolor(1)="cccccc"
kolor(2)="999999"
kolor(3)="666666"
kolor(4)="333333"
kolor(5)="000000"
function fademe(x)
document.bgcolor=kolor(x)
end function
for w=0 to 5
timer1=setTimer("fademe(w)", 5000)
timer1=clearTimer
next
Can someone tell me where I went wrong? Or is there another way to place a
5 second pause/wait between function calls? Thanks in advance for your help.