ellyz
12-27-2005, 11:34 AM
hi everyone,
I think my question should be simple, but I'm just not too falmiliar with all syntax tricks. I'd like to call a function hide(id) in the setTimeout() function, but hide has it's own params - (id) - and once inside setTimeout, id becomes undefinied.. Here's the example, to make myself clear:
function show(id, file) {
document.getElementById(id).src = file;
setTimeout("hide(id)", 1000);
}
there should be a way to put a parametered function inside setTimeout, no? :confused: cuz actually all examples I could find were like setTimeout("hide()", 1000), hide being empty...
oh, and here's the hide() function just in case:
function hide(id){
document.getElementById(id).src = 'back.gif';
}
thanks for your help!!
I think my question should be simple, but I'm just not too falmiliar with all syntax tricks. I'd like to call a function hide(id) in the setTimeout() function, but hide has it's own params - (id) - and once inside setTimeout, id becomes undefinied.. Here's the example, to make myself clear:
function show(id, file) {
document.getElementById(id).src = file;
setTimeout("hide(id)", 1000);
}
there should be a way to put a parametered function inside setTimeout, no? :confused: cuz actually all examples I could find were like setTimeout("hide()", 1000), hide being empty...
oh, and here's the hide() function just in case:
function hide(id){
document.getElementById(id).src = 'back.gif';
}
thanks for your help!!