PDA

View Full Version : Script conflicts


shaunie123
05-16-2003, 09:45 AM
Hi,

I have two elements on my page which I am trying to control with
JavaScript. They work fine on their own, but when I put both on the
page only the textfader works. I would be most grateful if some could
have a look at this for me.

http://www.mania.plus.com

Thanks for your time.

Weirdan
05-16-2003, 11:07 AM
//units sold script
....
function update(){
document.forms[0].time.value=sofar++;
theTimer=setTimeout("update()",12000);
}
....
//textfade.js
....
if (isChangeText) {
if (TS_pause < TS_speed)
timer = setTimeout('ScrollText(0)', TS_speed);
else
timer = setTimeout('ScrollText(1)', TS_pause);
} else
timer = setTimeout('ScrollText(0)', TS_speed);


Lines in red is conflicting. You can have set only one function on timeout.

cheesebagpipe
05-16-2003, 03:28 PM
You can set as many timers as you like (don't get carried away). It looks as if both scripts are working, although I have no idea what the 'units sold' one does (it's updating, though).