View Full Version : I have a challenge for you guys.. (setTimeout)
01-03-2009, 08:16 AM
ok I need to return the milliseconds from a setTimeout command/or function..
var return = setTimeout.argument.2000;
I have no idea how this would work but as you can see I need the actual number that was executed to be returned. Maybe there is a better way of doing something like this this?
01-03-2009, 10:53 AM
How's this work for ya:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
this.str_func = str_func;
this.ms = ms;
this.start = function()
this.ref = setTimeout(this.str_func,this.ms);
this.cancel = function()
if (this.ref) clearTimeout(this.ref);
window.onload = function()
var my_timeout = new SuperSetTimeout("alert('hey')",4000);
document.body.innerHTML = "my_timeout.ms = "+my_timeout.ms;
01-03-2009, 01:26 PM
Don't make things seem like it is a competition if you have no clue how to do it. Just ask your question. :)
01-03-2009, 07:34 PM
Wow Thanks!! :eek:
I must have been tired I been working on this thing all night to get it done. Thanks.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.