JavaScript 定时任务

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/test.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="height: 1000px;">
<button>按钮</button>
<button onclick="func1()">跳转到红页面</button>

<button onclick="func2()">关闭窗体</button>
<script type="text/javascript">

window.onscroll = function() {
console.log("发生了滚动")
var a = document.documentElement.scrollTop || document.body.scrollTop
console.log(a)
}
var time = window.setInterval(function(){
console.log("sunck is ")
},2000)
</script>

</body>
</html>

=========================================
window.setInterval= function(){
console.log("sunck is ")
},2000

猜你喜欢

转载自www.cnblogs.com/jeco-li/p/10176956.html