JavaScript之长图滚动
长图的滚动会涉及定时器:
我们先来回顾下定时器:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>定时器回顾</title>
</head>
<body>
<button id="start">开启</button>
<button id="stop">关闭</button>
<script type="text/javascript">
var start = document.getElementById("start");
var stop = document.getElementById("stop");
var num = 0,timer = null;
start.onclick = function ()<