PageSourceSearch

https://hrd4u.or.kr/hrd4u_new/js/popup02.js

js hrd4u.or.kr collected 2026-10-05 05:51:33 UTC 3,124 bytes, 93 lines download raw bytes

1$(document).ready(function () {
2	// 팝업창에 주어진 이름을 변수로 던져 저장된 쿠키가 있는지 확인         
3	var popup1 = getCookie('popup1');
4	var popup2 = getCookie('popup2');
5	var popup3 = getCookie('popup3');
6
7	// 변수가 없을경우 팝업 출력         
8	if (!popup1) {
9		popUpAction('popup1');
10		$(".main-notice-pop:eq(0)").css("left", 50);
11	}
12
13	// 변수가 없을경우 팝업 출력 
14	if (!popup2) { 
15		popUpAction('popup2'); 
16		var popupWidth = $(".main-notice-pop:eq(0)").outerWidth();
17		$(".main-notice-pop:eq(1)").css("left", 70 + popupWidth);
18	}
19
20	// 변수가 없을경우 팝업 출력 
21	if (!popup3) { 
22		popUpAction('popup3'); 
23		var popupWidth02 = $(".main-notice-pop:eq(0)").outerWidth() + $(".main-notice-pop:eq(1)").outerWidth();
24		$(".main-notice-pop:eq(2)").css("left", 90 + popupWidth02);
25
26	}
27});
28
29// 쿠키 가져오기 
30
31function getCookie(name) {
32	var nameOfCookie = name + "=";
33	var x = 0; while (x <= document.cookie.length) {
34		var y = (x + nameOfCookie.length);
35		if (document.cookie.substring(x, y) == nameOfCookie) {
36			if ((endOfCookie = document.cookie.indexOf(";", y)) == -1)
37				endOfCookie = document.cookie.length;
38			return unescape(document.cookie.substring(y, endOfCookie));
39		}
40		x = document.cookie.indexOf(" ", x) + 1; if (x == 0)
41			break;
42	}
43	return "";
44}
45
46// 24시간 기준 쿠키 설정하기 
47// expiredays 후의 클릭한 시간까지 쿠키 설정 
48function setCookie24(name, value, expiredays) {
49	var todayDate = new Date(); todayDate.setDate(todayDate.getDate() + expiredays);
50	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
51}
52
53// 00:00 시 기준 쿠키 설정하기 
54// expiredays 의 새벽 00:00:00 까지 쿠키 설정 
55function setCookie00(name, value, expiredays) {
56	var todayDate = new Date();
57	todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000 + 54000000);
58	if (todayDate > new Date()) {
59		expiredays = expiredays - 1;
60	}
61	todayDate.setDate(todayDate.getDate() + expiredays);
62	document.cookie = name + "=" + escape(value) + "; path=/; expires=" + todayDate.toGMTString() + ";"
63}
64
65// 팝업출력
66function popUpAction(name) {
67	// name으로 해당 팝업창 열기 
68	$("div[name=" + name + "]").fadeIn();
69}
70
71// 닫기버튼 클릭 이벤트 
72//$('.btn-close').click(function () {
73$(document).on("click", "button[class='btn-close']", function () {
74    
75	$(this).parent('.main-notice-pop').fadeOut();
76	// 오늘하루 보지않기 체크 확인 
77	if ($("input:checkbox[name=today_close1]").is(":checked") == true) {
78		setCookie00('popup1', "done", 1);
79	}
80
81	// 오늘하루 보지않기 체크 확인
82	if ($("input:checkbox[name=today_close2]").is(":checked") == true) {
83		setCookie00('popup2', "done", 1);
84	}
85
86	// 오늘하루 보지않기 체크 확인 
87	if ($("input:checkbox[name=today_close3]").is(":checked") == true) {
88		setCookie00('popup3', "done", 1);
89	}
90	
91	// name으로 해당 팝업창 닫기 
92	$(this).parent("div[name=" + name + "]").fadeOut();
93});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.