| [출처] 가자태자의 IT 이야기 http://talkit.tistory.com/66 팝업을 띄우고자 하시는 파일에 <script 부터 </script> 까지를 <head>와 </head> 사이에 넣으십시오 <script type="text/javascript"> <!-- function openwin(url1, width1, height1, scrollbars1) { var wmolc_popup = GetAttriCookie("k_info"); if(wmolc_popup!="") { }else { window.open(url1, "", "width=" + width1 + ", height=" + height1 +", scrollbars=" + scrollbars1); } } function GetAttriCookie( name ) { var nameOfCookie = name + "="; var x = 0; while ( x <= document.cookie.length ) { var y = (x+nameOfCookie.length); if ( document.cookie.substring( x, y ) == nameOfCookie ) { if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length; return unescape( document.cookie.substring( y, endOfCookie ) ); } x = document.cookie.indexOf( " ", x ) + 1; if ( x == 0 ) break; } return ""; } --> </script> 만드신 파일이 test1.html 이라면 WinSCP나 FTP프로그램으로 DocumentRoot 폴더 밑에 올리십시오. <body 태그를 찾아서 onLoad='openwin("/test1.html", "600", "600", "yes")' 를 추가 하십시오 여기서 test1.html은 만드신 파일이구용 첫번째 600은 가로 사이즈 두번째 600은 세로 사이즈 세번째 yes는 스크롤바를 생기도록 하겠다 no로 하시면 없애겠다가 됩니다. test.html 시작 ----------------------------- <html> <head> <title>팝업창 테스트</title> <script type="text/javascript"> <!-- function SetAttriCookie( name, value, expiredays ) { var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + "=" + escape( value ) + "; path=/;";// expires=" + todayDate.toGMTString() + ";" } function checkValue1() { if(document.pwinf.k_popup1.checked==true) { SetAttriCookie( "k_info", "1", 1 ) } window.close(); } --> </script> </head> <body> 내용<br> <form name="pwinf"> <input type="checkbox" name="k_popup1" value=1>Don't open this window today <input type="button" onClick="checkValue1();" value="닫기"> </form> </body> </html> test.html 끝 ----------------------------- test.html 처럼 문서를 만드셔야 합니다. 저문서를 토대로 만드시면 될것 같습니다. <body> </body> 사이에 "내용" 대신에 원하시는 내용으로 대체 하시면 됩니다. "IT Story / Coding" 분류의 다른 글
|
||||
IT Story/Coding |
2009/06/24 10:26 |
TAG 팝업창
Trackback address :: http://smilestory.net/trackback/105



Comments List