[Solved] How to create screensaver like screen in HTML, Jquery [closed]


$(document).ready(function(){
    var timeout;
    $(document).on("mousemove keydown click", function() {
        clearTimeout(timeout);
        timeout = setTimeout(function() {
             window.location = "homePage.htm";
        }, 2 * 60 * 1000);
    }).click();
});

All of the functions used above are well documented at either the jQuery site or MDN.

EDIT – Explanation of how this works: it sets a timer to redirect after two minutes. (Obviously this time can be adjusted.) If the user moves the mouse, clicks or types then clear the timer and set a new one. Trigger this handler once when the page first loads to start the first timer.

So if the user doesn’t trigger the handler within the 2 minute period the redirect will occur.

6

solved How to create screensaver like screen in HTML, Jquery [closed]