Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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
  • 2 weeks later...
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...