js When page at a certain time after the operation did not jump page

	    var maxTime = 5; // seconds
	    var time = maxTime;
	    $('body').on('keydown mousemove mousedown', function(e){
	        time = maxTime; // reset
	    });
	    var intervalId = setInterval(function(){
	        time--;
	        if(time <= 0) {
	            ShowInvalidLoginMessage();
	            clearInterval(intervalId);
	        }
	    }, 1000)
	    function ShowInvalidLoginMessage(){
	        window.location.href="http://www.baidu.com";
	    }
	    function reload1(){
	      time = maxTime; // reset**加粗样式**
	    }
Released four original articles · won praise 3 · Views 2475

Guess you like

Origin blog.csdn.net/ZQ960214/article/details/83451634