Grand Mamamouch
09-23-2004, 05:55 AM
Hi !
I'd like to make some texte appear gradually.
I found the name of the background and the text colors and great! thanx to someone of you, the name of the function that
translate decimals into hexadecimals.
For now, i don't work on the duration questions.
Here is where i am :
<div
id = texte
>
tbtuf6ny7idntyutbtuf6ny7idntyutbtuf6ny
</div>
<script language = 'Javascript'>
hd_bg = document.bgColor.replace('#', '0x')
hd_text = document.fgColor.replace('#', '0x')
current = hd_bg
delai = 22
function make_appear()
{
if( current < hd_text )
current++
else if( current > hd_text )
current--
else
alert('Fini!')
hd_current = current.toString(16)
document.getElementById('texte').innerHTML = " <a style = ' color : #" + hd_current + " ' > aaaaaaaaaaaaa </a> "
setTimeout(make_appear(), delai)
}
make_appear()
</script>
Problemes :
1. The alert window never comes out.
2. The coloring stops at yellow while the text beginning color is black.
Thanx for the hand !
Dominique
I'd like to make some texte appear gradually.
I found the name of the background and the text colors and great! thanx to someone of you, the name of the function that
translate decimals into hexadecimals.
For now, i don't work on the duration questions.
Here is where i am :
<div
id = texte
>
tbtuf6ny7idntyutbtuf6ny7idntyutbtuf6ny
</div>
<script language = 'Javascript'>
hd_bg = document.bgColor.replace('#', '0x')
hd_text = document.fgColor.replace('#', '0x')
current = hd_bg
delai = 22
function make_appear()
{
if( current < hd_text )
current++
else if( current > hd_text )
current--
else
alert('Fini!')
hd_current = current.toString(16)
document.getElementById('texte').innerHTML = " <a style = ' color : #" + hd_current + " ' > aaaaaaaaaaaaa </a> "
setTimeout(make_appear(), delai)
}
make_appear()
</script>
Problemes :
1. The alert window never comes out.
2. The coloring stops at yellow while the text beginning color is black.
Thanx for the hand !
Dominique