10. fadeToggle
- 사용법 : $(css선택자).fadeToggle(상태);
- 상태 : slow, fast 등
- css선택자가 있다면 천천히 사라지고, 없으면 천천히 나타남
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<button>Toggle Show</button>
<div class="page">
<h1>Lorem</h1>
<p>Lorem ipsum dolor sit amet</p>
</div>
<script src="http://code.jquery.com/jquery-3.1.0.js"></script>
<script>
$(function(){
$("button").click(function(){
$(".page").fadeToggle("slow");
});
});
</script>
</body>
</html>