별의 공부 블로그 🧑🏻‍💻
728x90
728x170
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!-- window 객체 예제1
     팝업창 띄우기 
     파일 이름 : winpopup.html -->   
<!DOCTYPE html>
<html>
<head>
<meat http-equiv="content-type" content="text/html"; charset="utf-8" />
<titile> window 객체 </titile>
<style type="text/css">
*{margin:0; padding:0;}
</style>
</head>
<body>
<p>
    <img src="images/window_obj_1.jpg" usemap="#intro" alt="신간 책 소개" />
        <map nam="intro" id="intro">
            <area shape="rect" coords="230,268,280,390" href="#" alt="창 닫기" onclick="window.close();" /> <!-- 클릭했을 때 현재 창을 닫음. -->
        </map>
</p>
</body>
</html>
 
<!-- 팝업 창을 열리도록 해 주는 오프너 페이지 -->
<!DOCTYPE html>
<html>
<head>
<meat http-equiv="content-type" content="text/html"; charset="utf-8" />
<titile> window 객체 </titile>
<script type="text/javascript">
    window.open("winpopup.html","pop1","width=300, height=400, left=300, top=10, scrollbars=no, toolbars=no, location=no");
</script>
</head>
<body>
    <h1> 이지 </h1>
</body>
</html>
 
 
 
<!-- 버튼을 눌렀을 때 팝업 창의 위치 또는 너비가 바뀌도록 하기 -->
<!DOCTYPE html>
<html>
<head>
<meat http-equiv="content-type" content="text/html"; charset="utf-8" />
<titile> window 객체 </titile>
<script type="text/javascript">
    var pop=window.open("winpopup.html","pop1","width=300, height=400, left=300, top=10, scrollbars=no, toolbars=no, location=no");
</script>
</head>
<body>
    <p>
        <button onclick="pop.moveTo(200,300); pop.focus();">
    </p>
    <p>
        <button oncliick="pop.resizeTo(200,300); pop.focus();">
    </p>
</body>
</html>
 
<!-- window 객체 예제2 -->
<html>
<script type="text/javascript">
    var i=0;
    var auto=setInterval("console.log(i++);",3000);
</script>
</head>
<body>
    <button onclick="clearInterval(auto)">정지 버튼</button>
</body>
</html>
 
<!-- widnow 객체 예제3 -->
<script type="text/javascript">
    var i=0;
    var auto=setTimeout("console.log(++i);",3000);
</script>
 
cs

 

 

소스 출처 : Do It! 자바스크립트+제이쿼리 입문 (정인용 지음, 이지스퍼블리싱)

728x90
그리드형(광고전용)

'Source Code > JavaScript' 카테고리의 다른 글

navigator 객체  (0) 2017.05.21
history 객체  (0) 2017.05.21
location 객체  (0) 2017.05.21
screen 객체  (0) 2017.05.21
현재 월에 해당하는 달력 출력  (0) 2017.05.21
정규 표현 객체  (0) 2017.05.21
이메일 유효성 검사  (0) 2017.05.21
문자 객체  (0) 2017.05.21
⚠️AdBlock이 감지되었습니다. 원할한 페이지 표시를 위해 AdBlock을 꺼주세요.⚠️
starrykss
starrykss
별의 공부 블로그 🧑🏻‍💻


📖 Contents 📖