Forum Moderators: open
It works up to the visibility.hidden part but then as soon as the stuff starts to run after 5 seconds (timout), the error appears.
Any ideas?
Thanks.
There are two solutions to this that don't require a global variable.
The second is my preferred, because it does away with string nonsense in the timer.
function brieflyHideMenus(varDJID)
{
var id = 'DJdiv' + varDJID;
document.getElementById(id).style.visibility='hidden';
// note single quotes on id
setTimeout("document.getElementById('"+id+'").style.visibility='visible'", 5000);
}function brieflyHideMenus(varDJID)
{
var div = document.getElementById('DJdiv' + varDJID);
div.style.visibility='hidden';
setTimeout( function(){div.style.visibility='visible'}, 5000);
}