I want to display a price alarm pop up after 10 seconds of inactivity of user. Right now the pop up appears only on click. I want to replace it.
I tried my best but couldn't get it done.
$(document).ready(function () {
var idleInterval = setInterval(inActiveTimer, 1000);
$(this).mousemove(function (e) {
idleTime = 0;
});
$(this).keypress(function (e) {
idleTime = 0;
});
$(".sleepy-close, .sleepy-overlay, .sleepy-wake-up").click(function () {
$(".sleepy-overlay").hide();
clearInterval(idleInterval);
});
});
The last part of the code leads to click enabled pop up. How can I replace it with automatic pop up which occurs after 10 seconds of inactivity.