I have a web application and when the user is logged in, I would like to display a popup after some time if the user doesn't do anything to warn him that he will be logged out soon.
So I used intervals and I reset it each time the user interacts :
$(this).mousedown(function () {
reset();
});
$(this).mousemove(function () {
reset();
});
$(this).scroll(function () {
reset();
});
$(this).mouseup(function () {
reset();
});
$(this).click(function () {
reset();
});
$(this).keypress(function () {
reset();
});
But in some case, the timer is not reset and the popup shows up when the user is still using the application, for example when scrolling in a div.
Do I have to add my reset function to all possible events in my application or is there a simpler way to detect any interaction ?
document
. – Extrude