반응형
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function() {
$("#start").click(function() {
$("div").animate({ left: "100px" }, 1000);
$("div").animate({ fontSize: "3em" }, 5000);
});
$("#stop").click(function() {
$("div").stop();
});
$("#stop2").click(function() {
$("div").stop(true);
});
$("#stop3").click(function() {
$("div").stop(true, true);
});
});
</script>
<title>Document</title>
</head>
<body>
<button id="start">Start</button>
<button id="stop">Stop</button>
<button id="stop2">Stop all</button>
<button id="stop3">Stop but finish</button>
<div
style="background:#98bf21; height:100px; width:200px; position:absolute;"
>
HELLO
</div>
</body>
</html>
반응형
'2020 > JQuery' 카테고리의 다른 글
JQuery not() (0) | 2020.03.06 |
---|---|
JQuery 현재요소, 다음요소, next(), nextAll() (0) | 2020.03.06 |
JQuery 엘리먼트 순서 알아내기 (0) | 2020.03.05 |
JQuery height, width (0) | 2020.03.05 |
JQuery prop, 체크박스 전체 선택, 전체 해제 (0) | 2020.03.05 |