※ animate - slideDown()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#flip").click(function(){
$("#panel").slideDown(5000);
});
$("#stop").click(function(){
$("#panel").stop();
});
});
</script>
<style>
#panel, #flip {
padding: 5px;
font-size: 18px;
text-align: center;
background-color: #555;
color: white;
border: solid 1px #666;
border-radius: 3px;
}
#panel {
padding: 50px;
display: none;
}
</style>
</head>
<body>
<button id="stop">Stop sliding</button>
<div id="flip">Click to slide down panel</div>
<div id="panel">Hello world!</div>
</body>
</html>
※ 실행화면(클릭을 하였을 때)
'jQuery 수업' 카테고리의 다른 글
jQuery-11(get적용- text(), html()) (0) | 2020.02.19 |
---|---|
jQuery-10(css- color 적용) (0) | 2020.02.19 |
jQuery-8(animate()) (0) | 2020.02.19 |
jQuery-7(이벤트 slideUp(), slideDown()) (0) | 2020.02.19 |
jQuery-6(이벤트 fadeIn(), fadeOut(), fadeTo(), fadeToggle()) (0) | 2020.02.19 |