I found a script on W3C that makes images fade in and out and am trying to pair it with a script that rotates images. I can get it to work when I set the fade in and fade out seperate to MOUSEOVER and MOUSEOUT, but when I try to put the function calls in the picture rotation script it stops working. I can get it to either fade in or fade out, but as soon as I add the call to the other function is stops working. Below is my code any ideas?
Code:
j=0
function refresh()
{
clean()
document.getElementById('pic').src='imagess/pic' + j + '.gif'
fog()
j+=1
if (j > 2)
{
j=0
}
setTimeout('refresh()', 2*1000)
}
function clean()
{
interval=setInterval("makeclean(pic)",50)
}
function fog()
{
interval=setInterval("foggy(pic)",50)
}
function foggy()
{
if (document.getElementById('pic').filters.alpha.opacity!=44)
{
document.getElementById('pic').filters.alpha.opacity-=4
}
else
{
clearInterval(interval)
}
}
function makeclean()
{
if (document.getElementById('pic').filters.alpha.opacity<100)
{
document.getElementById('pic').filters.alpha.opacity+=4
}
else if (window.interval)
{
clearInterval(interval)
}
}