时间:2021-07-01 10:21:17 帮助过:5人阅读
<script> var count = 0; var outTime=30;//分钟 window.setInterval(go, 1000); function go() { count++; if (count == outTime*60) { alert("您因长时间未进行操作导致页面过期"); } } var x ; var y ; //监听鼠标 document.onmousemove = function (event) { var x1 = event.clientX; var y1 = event.clientY; if (x != x1 || y != y1) { count = 0; } x = x1; y = y1; }; //监听键盘 document.onkeydown = function () { count = 0; };</script>
以上就是js鼠标键盘无操作实例的详细内容,更多请关注Gxl网其它相关文章!