淡入 淡出
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<style>
#div1{
width: 200px;
height: 200px;
background-color:aqua;
display: none;
}
</style>
</head>
<body>
<button id="box1">淡入</button>
<button id="box2">淡出</button>
<div id="div1">
</div>
<script src="js/jquery-3.4.1.js"></script>
<script>
$("#box1").click(function(){
$("#div1").fadeIn();
});
$("#box2").click(function(){
$("#div1").fadeOut();
});
</script>
</body>
</html>