<script> jumpOut(0.2) //判断用户有没有操作页面 function jumpOut(time) { var userTime = (time || 2) * 60; var objTime = { init:0, time:function(){ objTime.init += 1; if(objTime.init == userTime){ alert('打开时间超时'); } }, eventFun:function(){ clearInterval(testUser); objTime.init = 0; testUser = setInterval(objTime.time,1000); } } var testUser = setInterval(objTime.time,1000); var body = document.querySelector('html'); body.addEventListener("touchstart",objTime.eventFun); body.addEventListener("click",objTime.eventFun); } localStorage.setItem('hi','woshi 1'); localStorage.setItem('hi','woshi 22222222'); </script>
JS写页面不操作则跳出
最新推荐文章于 2024-03-20 15:07:36 发布