$(window) : jQuery window 객체
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<!-- <script src="/Lecture-WEB/jquery/js/jquery-3.5.1.min.js"></script> -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(window).load(function() { //1점대의 jQuery에서만 먹힘
console.log('load...')
})
$(window).resize(function() {
console.log('resize...')
})
$(window).scroll(function() {
console.log('scroll...')
})
$(document).ready(function() { // ready - load 순으로 실행된다
console.log('ready...')
})
</script>
</head>
<body>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
<h1>Hello</h1>
</body>
</html>
'웹 프로그래밍 > jQuery' 카테고리의 다른 글
[jQuery] animate 기본 및 활용 (0) | 2020.06.23 |
---|---|
[jQuery] 숨기는 것 관련 함수(hide, show, fadeOut, ...) (0) | 2020.06.23 |
[jQuery] 여러개의 이벤트를 처리하기 : $('태그명').on (0) | 2020.06.23 |
[jQuery] focus, blur (0) | 2020.06.23 |
[jQuery] 키보드 관련 이벤트 : keyup, keydown (0) | 2020.06.23 |