自动页面刷新 [英] Automatic page refresh

查看:72
本文介绍了自动页面刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在鼠标移动5秒后使用jquery自动刷新页面。

i编写了autorefresh代码,但是如何添加鼠标功能



How to automatic refresh a page using jquery after the movement of mouse for 5 sec.
i have coded the autorefresh code but how to add the mouse function

var to = setTimeout(function () { window.location.reload() }, 5000);
jQuery('body').mousemove(function () { clearTimeout(to); });

推荐答案

简单解决方案


(document).ready(function(){
(document).ready(function () {


< span class =code-string> html)。mousemove(function(){
setTimeout(function(){location.reload();}, 5000 );
});
});
("html").mousemove(function () { setTimeout(function () { location.reload(); }, 5000); }); });


这篇关于自动页面刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆