<body 이외에 팝업을 넣을수 있을까요 ?
현재
<script language="JavaScript">
<!--
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//-->
</script>
</head>
와
<body onunload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 클로우즈 될때 사이트 팝업
<body onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 오픈될때 사이트 팝업
이용하려고 하는데
head.sub.php 의 <body> 에 넣으면 게시판에 들어갈때,나올때 마다 계속 불려져 오게 됩니다.
다른 방법이 없을까요 ?
원하는건 사이트를 완전히 닫고 나올때 특정사이트가 팝업이 되도록 하는 것입니다.
<script language="JavaScript">
<!--
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
//-->
</script>
</head>
와
<body onunload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 클로우즈 될때 사이트 팝업
<body onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1);">
사이트 오픈될때 사이트 팝업
이용하려고 하는데
head.sub.php 의 <body> 에 넣으면 게시판에 들어갈때,나올때 마다 계속 불려져 오게 됩니다.
다른 방법이 없을까요 ?
원하는건 사이트를 완전히 닫고 나올때 특정사이트가 팝업이 되도록 하는 것입니다.
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 6개
위에 소스는 페이지 로딩되는 아무데나 넣으면 되구여...헤드나 메인이나 풋이나...셋중에 추천은 메인에다가..
<!--
//쿠키값을 가져오는 함수
function getCookie(name) {
var from_idx = document.cookie.indexOf(name+'=');
if (from_idx != -1) {
from_idx += name.length + 1
to_idx = document.cookie.indexOf(';', from_idx)
if (to_idx == -1) {
to_idx = document.cookie.length
}
return unescape(document.cookie.substring(from_idx, to_idx))
}
}
var CloseDate = new Date("December 31, 2003"); //팝업 윈도우를 닫고자 하는 날짜를 입력하세요.
var Today = new Date(); //오늘 날짜
if (Today < CloseDate)
{
//getCookie 함수를 호출하여 쿠키값을 가져온다.
var blnCookie = getCookie("op1");
//쿠키값이 true가 아닐 경우에만 새 창을 띄운다.
if ( !blnCookie ) {
win = window.open("pop.htm","op1","width=600,height=710,left=0,top=0");
win.focus();
}
}
//-->
</script>
document.onload="open_window('win', 'http://사이트.co.kr/', 0, 0, 1024, 768, 1, 1, 1, 1, 1)";
</script>