What is the best way to signal the user, if he is useless on the webpage for the past 5 minutes, I mean Knowing that the use of on web pages for the last 5 minutes is useless.
Just set up some event listeners with timer to trigger a custom audience / event I suggest encouraging many unique user-driven events.
I'm a little cheating and using jQuery for some demo codes, all of this can be done entirely in JavaScript, but it exists for jQuery like this thing:
$ (window) .bind ('Mausammov mouseclick keydown mosaichel ... more listeners ...', inactive); Function useless (e) {if (window.idleTimeout) {clearTimeout (window.idleTimeout); } Window.idleTimeout = setTimeout (user idl, 300000); } Function userIdle () {// do either things here or trigger the "idle" event $ (window). Triggers ('inactive'); }
Comments
Post a Comment