<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>淡入淡出效果</title>
<style>
body{text-align: center;}
</style>
</head>
<body>
<img src="img/ad.jpg" /><br/>
<input name="fadein_btn" type="button" value="淡入" />
<input name="fadeout_btn" type="button" value="淡出" />
<script src="js/jquery-1.12.4.js" ></script>
<script>
$(document).ready(function() {
$("input[name=fadein_btn]").click(function(){
$("img").fadeIn("slow");//淡入
});
$("input[name=fadeout_btn]").click(function(){
$("img").fadeOut(1000);//淡出
});
});
</script>
</body>
</html>
作业11-淡入淡出效果
最新推荐文章于 2021-03-18 15:49:33 发布