一、定时器
setTimeout:在多少毫秒之后,执行一段程序
$(function(){
setTimeout(function(){
$("#a1").text("动态生成!!");
},3000);
});
</script>
setInterval:每隔多少毫秒,执行程序
$(function(){
setInterval(function(){
$("#a1").append("定时器添加!")
},1000);
});
</script>
案例一:轮播图
首先 写HTML布局
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div id="content">
<img src="img/01.jpg" id="pic">
</div>
<div id="ctrl">
<button id="befer">上一张</button>
<button id="after">下一张</button>
</div>
</body>
</html>
第二步 写css布局
<html>
<