0

I have a wordpress site that will be used as a kiosk.

If someone uses the site and leaves I need it to return to the homepage after a period of inactivity.

I am aware there are javascript and jquery scripts out there but none seem to work for WordPress.

Can someone help? If you provide code can you also advise me where to place it e.g. header or footer?

user1595053
  • 21
  • 1
  • 2
  • Personally, if I've opened a tab meaning to read it later, and you have it redirected by the time I actually get to it, I would find it _very_ annoying, not to mention confusing. – Foxinni Aug 13 '12 at 13:04

1 Answers1

0

Javascript in the footer most likely, with a window.location = 'http://yoursite.com'; along with setTimeout ( http://www.tizag.com/javascriptT/javascriptredirect.php ) should do the redirecting just fine.

The main issue here is that browsers buffer all setIntervals and setTimeouts when the tab is inactive.

This post: ( When using setInterval, if I switch tabs in Chrome and go back, the slider goes crazy catching up ) ... will give you a few pointers on when to detect when a page is active or in 'idle'

And this ( How can I make setInterval also work when a tab is inactive in Chrome? ) on will give you some tips on when to check weather the setTimeout time really has passed regardless of inactive tabs.

Community
  • 1
  • 1
Foxinni
  • 3,980
  • 2
  • 26
  • 26