"JQuery 시작하기"의 두 판 사이의 차이

24번째 줄: 24번째 줄:
</head>
</head>
<body>
<body>
<p>클릭하면 사라집니다.</p>
<p>클릭하면 사라집니다 1</p>
<p>클릭하면 사라집니다 2</p>
</body>
</body>
</html>
</html>

2012년 2월 19일 (일) 23:56 판

  • jQuery 시작하기
  • jQuery hide()

1 어떤 js를 연결하는 것이 좋을까?

  • 버전별 js파일은 http://code.jquery.com 에 있다.
  • 거기에는 또 같은 버전이라도 비압축 버전(uncompressed)과 압축버전(compressed)이 있다.
  • 안정화 최신 버전은 http://code.jquery.com/jquery.js (일반버전)과 http://code.jquery.com/jquery.min.js (압축버전)이다. 이것으로 연결하면 jquery 측에서 안정화 버전을 올릴 때, 자동으로 업데이트가 되는 효과가 있다. 물론 이로 인해서 예전에 되던 기능이 되지 않을 수도 있을 것이다.

2 example01.php

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>클릭하면 사라집니다 1</p>
<p>클릭하면 사라집니다 2</p>
</body>
</html>

3 숙제

  • "클릭하면 사라집니다." 위에 마우스를 올리면 마우스 커서가 손모양이 되도록 해보자.

4 참고자료

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}