PDA

View Full Version : Could I have any help with SetTimeOut please?


l3vi
02-08-2003, 08:08 PM
Okay, I am trying to make a message that pops up for about 5 seconds, than it dissapears automatically, but I do not want an alert box. I have buttons that trigger what the message says and turns it on, this is what the buttons code is: onClick="alert('Menu...')" for the menu button. A box should popup for a few seconds, saysing Menu. This is my coding for that.

function deleteMessageLayer() {
document.body.removeChild(msgObj);
alObj=null;
}
function alert(msgHTML) {

alObj=document.createElement("div");
document.body.appendChild(alObj);


alData='<table cellpadding="0" cellspacing="0" border="0" style="width:25%;height:10%;position:absolute;left:325;top:180;z-index:1;"><tr><td align="center" valign="middle">';
alData+='<table cellpadding="0" cellspacing="12" border="0" style="-moz-box-sizing:border-box;font:15px comic sans ms,arial;color:#666666;font-weight:bold;background-color:#BFC4B0;border:1px solid #666666;width:250px;filter:progid:DXImageTransform.Microsoft.Shadow(color=#666666,direction=135,stre ngth=5);">';
alData+='<tr>';
alData+='<td align="center">'+msgHTML+'</td>';
alData+='</tr>';
alData+='</table>';
alData+='</td></tr></table>';
alObj.innerHTML = alData;
setTimeOut("deleteMessageLayer()",5000)
}

I keep getting an error.
Any help would be Greatly appriceated!:thumbsup:

Owl
02-08-2003, 11:41 PM
Hi l3vi,

setTimeOut should be setTimeout

( •) (• )
>>V

l3vi
02-09-2003, 01:29 AM
I figured that one out, now Im running into more problems. I can figure them out on my own though, BTW, Thanx!:thumbsup:

glenngv
02-10-2003, 03:27 AM
...and try to rename your alert(msgHTML) function. It will conflict with the built-in function window.alert()