<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jquery的动画效果</title>
<script type="text/javascript" src="jquery-3.3.1.min.js"></script>
<style type="text/css">
.mian{
높이: 240px;
너비: 200px;
margin-right: 20px;
float:left;
}
.box1,.box2 {
높이: 200px;
너비: 200px;
배경: 빨간색;
}
버튼{
높이: 40px;
너비: 200px;
테두리: 없음;}
</style>
<script type="text/ javascript">
$(document).ready(function(){
$('.box1').hide()
$('.btu1').click(function(){
$( '.box1').fadeIn(1500)
})
$('.btu2').click(function(){
$('.box2').fadeOut(1500)
})
})
</script>
</head>
<body>
<div class="mian">
<button class="btu1">淡入</button>
<div class="box1"></div>
</div>
<br>
<div>
<button class="btu2">淡출</button>
<div class="box2"></div>
< ;/div>
</body>
</html>