473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

setTimeout - does it reset when the mouse is moved?

How does setTimeout work? If the user moves the mouse or types some text
into a form, does it reset the timer? Or does it start running when first
triggered and simply timeout after that amount of time?

For example, if the timeout is set to 5 minutes and after 4.5 mins, the user
moves the mouse over the screen, does the timer reset to 5 mins or will it
still timeout after another 30 seconds?

Cheers, Rob.
Oct 3 '05 #1
2 2198
On 03/10/2005 12:07, Rob Nicholson wrote:
How does setTimeout work? If the user moves the mouse or types some text
into a form, does it reset the timer? Or does it start running when first
triggered and simply timeout after that amount of time?


The latter. It simply executes code - either a string containing
statements or a function reference[1] - after a specified number of
milliseconds[2].

[snip]

Mike
[1] See the FAQ for notes on the using a function reference.

<URL:http://www.jibbering.com/faq/faq_notes/misc.html#mtSetTI>

[2] In reality, the delay is only an approximation. Windows 9x,
for instance, only has a resolution of 55 milliseconds, so
accuracy is far from guaranteed.

<URL:http://www.merlyn.demon.co.uk/js-date0.htm#TaI>

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Oct 3 '05 #2

Well, setTimeout() is oblivious to any event unless the event has a
functino bound that clears it out, otherwise, it's timing moves on
regardless of events, if you gave it 300000ms, it'll execute 5mins from
runtime launch undeterred.
Danny
Oct 4 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
Hey, I posted a question yesterday that was pretty confusing. I've figured out some of it for myself, but there's still one issue that I can't figure out, and I've been trying for months now! ...
5
by: QA | last post by:
<img src=http://xxx.com/yyy.jpg onmouseover="settimeout(\"document.location='http://www.google.com'\"), 2000"> I want to have a 2 seconds delay before it is directed to an URL when the mouse is...
4
by: Telmo Costa | last post by:
I have a HTML page with a form with 2 buttons like this .... <input type="button" value="Add" onClick="ClickAdd();"/> <input type="button" value="Reset" onClick="ClickReset();"/> .... I...
3
by: jshanman | last post by:
I've created a "Play" button for my timeline that uses the Google Maps API. It basicly scrolls the timeline x interval every y milliseconds. The problem is the browser responds slowly even after...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
4
by: E | last post by:
I am having trouble with setTimeout working on a second call to the setTimeout function from a second page which is an html page. Here is the scenario. I have a web page and onload it calls a...
2
by: Ian A. Mason | last post by:
Consider the simple example: http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_stop Note that if you press the start button N times, the counter increments by 1, N times. So you must...
18
by: barry | last post by:
I'm having a problem creating a delay before each list item gets moved ( http://www.polisource.com/PublicMisc/list-splitter-timeout-bug.html ). Choose any number of columns, vertical layout, and...
2
by: joey.powell | last post by:
Hey guys I have some js code as follows... ------- var SessionTimer; function StartSessionTimer() { SessionTimer = setTimeout('RedirectToSessionTimedOutPage(),60000) }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.