":animated" 는 화면에서 움직이는 요소를 찾아내는 선택자입니다.
원문 링크
http://api.jquery.com/animated-selector/
개요 : 화면에서 움직이는(animated) 요소를 찾아줍니다.
예 제
화면에서 움직이는 요소를 찾아 색깔을 바꿔 줍니다.
<!DOCTYPE html>
<html>
<head>
<style>
div { background:yellow; border:1px solid #AAA; width:80px; height:80px; margin:0 5px; float:left; }
div.colored { background:green; }
</style>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
<button id="run">Run</button>
<div></div>
<div id="mover"></div>
<div></div>
<script>
$("#run").click(function(){
$("div:animated").toggleClass("colored");
});
function animateIt() {
$("#mover").slideToggle("slow", animateIt);
}
animateIt();
</script>
</body>
</html>
미리보기
와. 간단하네요. jQuery 좋지 않으세요? ^^.
그럼 즐프하세요.
'프로그래밍 > jQuery' 카테고리의 다른 글
| jQuery 쉽게하기 - API 깨부시기, 선택자(Selector) : [name$="value"] (2) | 2011.01.22 |
|---|---|
| jQuery 쉽게하기 - API 깨부시기, 선택자(Selector) : [name~="value"] (2) | 2011.01.21 |
| jQuery 쉽게하기 - API 깨부시기, 선택자(Selector) : [name*="value"] (2) | 2011.01.21 |
| jQuery 쉽게하기 - API 깨부시기, 선택자(Selector) : [name|="value"] (2) | 2011.01.20 |
| jQuery 쉽게하기 - API 깨부시기, 선택자(Selectors) : All Selector ("*") (14) | 2011.01.19 |
| jQuery 쉽게하기 - API 깨부시기, jQuery Core (12) | 2011.01.19 |
| jQuery 쉽게하기 - 기본부터 시작하자, 함수(Function) 편 (4) | 2011.01.18 |
| jQuery 쉽게하기 - 기본부터 시작하자, 배열(Array) 편 (4) | 2011.01.18 |