...

View Full Version : Detect screen idle time



loeddie
03-23-2004, 03:36 AM
Dear all,

I would like to know if javascript can detect the screen idle time, if certain time come up in idle, then it will redirect to another page, any help will be appreciate, thanks!

Eddie

glenngv
03-23-2004, 04:38 AM
You might get some idea from this thread (http://www.codingforums.com/showthread.php?s=&threadid=33068).

kenzo20
01-12-2012, 11:02 AM
http://www.google.com/url?sa=t&rct=j&q=jquery%20idletimer%20plugin&source=web&cd=10&ved=0CHIQFjAJ&url=http%3A%2F%2Fwww.webtechresources.com%2F2011%2F12%2Fjquery-idletimer-plugin-cool-plugin-check-user-is-idle%2F&ei=KbwOT_aRFcPo8QPG4aiIBA&usg=AFQjCNE7tMG2OgW_Sm4i47tC0Inkfn31DQ

Philip M
01-12-2012, 12:06 PM
Something like this:-


<body onload = "checktime()">

<script type="text/javascript">
var count = 0;
var tim;
function checktime() {
count ++;
if (count=10) { // 10 seconds but better extend to several minutes
window.location.href = "http://www.google.com"
}
tim = setTimeout(checktime,1000);
}

document.onkeydown = function( evt ) {
evt = evt || event;
count = 0;
window.clearTimeout(tim);
setTimeout(checktime,1000);
}

document.onmousedown = function(evt) {
evt = evt || window.event;
count = 0;
window.clearTimeout(tim);
setTimeout(checktime,1000);
}

</script>


Brevior saltare cum deformibus mulieribus est vita - Life is too short to dance with ugly women

Philip M
01-12-2012, 12:22 PM
Something like this:-


<body onload = "checktime()">

<script type="text/javascript">
var count = 0;
var tim;
function checktime() {
count ++;
if (count=10) { // 10 seconds
window.location.href = "http://www.google.com"
}
tim = setTimeout(checktime,1000);
}

document.onkeydown = function( evt ) {
evt = evt || event;
count = 0;
window.clearTimeout(tim);
setTimeout(checktime,1000);
}

document.onmousedown = function(evt) {
evt = evt || window.event;
count = 0;
window.clearTimeout(tim);
setTimeout(checktime,1000);
}

</script>


Brevior saltare cum deformibus mulieribus est vita - Life is too short to dance with ugly women



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum