ini?想的太复杂了吧?
function sw()
{
xx=setTimeOut(location.href=index.htm,n)
}
document.onmouseover=clearTimeOut(xx)
<body onload=sw()>
function sw()
{
xx=setTimeOut(location.href=index.htm,n)
}
document.onmouseover=clearTimeOut(xx)
<body onload=sw()>
是否应该先写一个判断鼠标是否有动的判断先呢???
基本想法是鼠标在一定的时间内坐标没有改变的话视为不动,之后调用刷新
<META HTTP-EQUIV="Refresh" Content="n;URL=index.htm">
其中:"n"为停留的秒数,index.htm是将要跳转到的页面。
function go()
{
location.href="http://www.csdn.net";
}function notgo()
{
clearTimeout(mygo);
mygo=setTimeout(go,2000);
}
document.onmouseover=notgo;
document.onmousemove=notgo;
document.onmouseout=notgo;
document.onmousedown=notgo;
document.onmouseup=notgo;
document.onkeydown=notgo;
mygo=setTimeout(go,2000);
</script>