用JQuery实现颜色自动跳转
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="jquery.js"></script>
<style>
.red {
width: 300px;
height: 300px;
background-color: fuchsia;
}
.blue {
width: 300px;
height: 300px;
background-color: blue;
}
</style>
</head>
<body>
<div class="red"></div>
<input type="button" id="stop" value="停止"/>
<input type="button" id="continue" value="继续"/>
<script type="text/javascript">
var interval = null;
$(function () {
interval = setInterval(function () {
$("div").toggleClass("blue"