SteveoAtilla Posted September 13, 2006 Posted September 13, 2006 Hello! I have a customer that is using kiosk-type machines for multiple users. What they would like to happen is, after X minutes of inactivity, the page will re-direct to their Kiosk Home Page. I have found a few posts about a java applet that can be loaded onto the page to run and keep track of inactivity, but have not seen any code. Does anyone have a solution that would work? Thanks, Steveo Quote The three most important things in life: God, your family, and the Green Bay Packers -- Not necessarily in that order. Winning is not a sometime thing. You don't win once in a while, you don't do things right once in a while, you do them right all the time. Winning is a habit. Unfortunately, so is losing. -- Vincent T. Lombardi
Gill Bates Posted September 28, 2006 Posted September 28, 2006 Here's a simple approach:<script language="javascript" type="text/javascript"> var date = new Date(); document.onmousemove = function(event) { date = new Date(); }; function check() { var amount = new Date() - date; // display for debugging purposes window.status = amount; if (amount > 5000) { // user has not moved the mouse in the past 5 seconds // so we should redirect them... window.location = "http://www.espn.com"; } else { setTimeout("check()", 1000); } } </script> <body onload="check()">You could also hook keyboard related events if you wanted and update the "date" variable. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.