팝업창 모음

<SPAN class=d_12_6D6765><FONT color=#666666> </FONT>
<P><FONT color=#333333>1. 옵션을 HEAD안에...<BR><script language="JavaScript"><BR>function openNewWindow(window) {<BR>open (window,"NewWindow","left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=200, height=200");<BR>}<BR></script> <BR><a href=javascript:openNewWindow("주소입력")>새창열기</a></FONT></P>
<P><FONT color=#333333>2. 링크에 옵션을 지정...<BR><a href="javascript:;" onclick="window.open('주소입력','name','resizable=no width=200 height=200');return false">새창열기</a></FONT></P>
<P><FONT color=#333333>* 옵션 *<BR>새창 뛰울때 용도에 맞게 옵션 설정을 해줍니다. "YES" 또는 "NO" 로 지정 해주면 됩니다. <BR>menubar - 파일, 편집, 보기....부분<BR>toolbar - 뒤로, 앞으로, 새로고침 아이콘등이 있는 부분<BR>directories - 연결 디렉토리가 표시되는 부분<BR>location - 주소 입력창<BR>status - 아래 브라우저 상태 바<BR>scrollbars - 스크롤<BR>resizable - 리사이즈 옵션</FONT></P>
<P> </P>
<P><BR><FONT color=#ff3399><STRONG><FONT size=2>1.자동 띄우기</FONT></STRONG> </FONT></P>
<P>팝업창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><script language="javascript"><BR><!--<BR>function pop(){ <BR>window.open("팝업창파일", "pop", "width=400,height=500,history=no,resizable=no,status=no,scrollbars=yes,menubar=no")<BR>}<BR>//--><BR></script><BR></head><BR><body onload="javascript:pop()"><BR>이벤트 팝업창을 띄우기<BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>2.프레임이 있는 팝업창 닫기</STRONG></FONT> </P>
<P>팝업창에 삽입<BR><<FONT color=#177fcd>html><BR><head><BR><title></title> <BR><script language="Javascript"> <BR><!-- <BR>function frameclose() { <BR>parent.close() <BR>window.close() <BR>self.close() <BR>} <BR>//--> <BR></script><BR></head> <BR><body><BR><a href="javascript:frameclose()">프레임셋 한방에 닫기</a><BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>3.팝업창 닫고 프레임이 없는 부모창에서 원하는 페이지로 이동하기</STRONG></FONT> </FONT></P>
<P>팝업창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title> <BR><script language="javascript"><BR><!--<BR>function MovePage() {<BR>window.opener.top.location.href="연결할파일"<BR>window.close()<BR>}<BR>//--><BR></script><BR></head><BR><body><BR><a href="javascript:MovePage();">자세한내용보기</a><BR></body><BR></html></FONT></P>
<P><BR><STRONG><FONT size=2><FONT color=#ff3399>4</FONT><FONT color=#ff3399>.팝업창 닫고 프레임이 있는 부모창에서 원하는 페이지로 이동하기 </FONT></FONT></STRONG></P>
<P>팝업창에 삽입하고 팝업창의 설정은 프레임셋 페이지에 해야함<BR>오픈창이 아닐경우에는 window.top.프레임이름.location.href="연결할파일" 적용한다<BR><FONT color=#177fcd><html><BR><head><BR><title></title> <BR><script language="javascript"><BR><!--<BR>function MovePage() {<BR>window.opener.top.프레임이름.location.href="연결할파일"<BR>//팝업창이 아닌것우..<BR>window.close()<BR>}<BR>//--><BR></script><BR></head><BR><body><BR><a href="javascript:MovePage();">자세한내용보기</a><BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>5.팝업창 자동으로 닫기</STRONG></FONT></P>
<P>팝업창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>Close Window Timer</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR><!--<BR>function closeWin(thetime) {<BR>setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.<BR>}<BR>//--><BR></script><BR></head> <BR><body onLoad="closeWin('5000')"><BR>이창은 5초후 자동으로 창이 닫힘니다.<br><BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399><STRONG><FONT size=2>6.프레임 나눈 팝업창 한번에 닫기</FONT> </STRONG></FONT></P>
<P>팝업창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>Close Window Timer</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR><!--<BR>function closeWin(thetime) {<BR>setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.<BR>}<BR>//--><BR></script><BR></head> <BR><body onLoad="closeWin('5000')"><BR>이창은 5초후 자동으로 창이 닫힘니다.<br><BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>7.하루동안 팝업창 띄우지 않기 소스 예제1</STRONG></FONT> </FONT></P>
<P>부모창인 index.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="javascript"> <BR><!--<BR>function getcookie(name) <BR>{ <BR>var Found = false <BR>var start, end <BR>var i = 0 <BR>// cookie 문자열 전체를 검색 <BR>while(i <= document.cookie.length) <BR>{ <BR>start = i <BR>end = start + name.length <BR>// name과 동일한 문자가 있다면 <BR>if(document.cookie.substring(start, end) == name) <BR>{<BR>Found = true <BR>break <BR>} <BR>i++ <BR>} <BR>// name 문자열을 cookie에서 찾았다면 <BR>if(Found == true) { <BR>start = end + 1 <BR>end = document.cookie.indexOf(";", start) <BR>// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다) <BR>if(end < start) <BR>end = document.cookie.length <BR>// name에 해당하는 value값을 추출하여 리턴한다. <BR>return document.cookie.substring(start, end) <BR>} <BR>// 찾지 못했다면 <BR>return "" <BR>} <BR>function openMsgBox() <BR>{ <BR>var eventcookie=getcookie("memo"); <BR>if (eventcookie != "no") <BR>window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150'); <BR>//팝업창의 주소, 같은 도메인에 있어야 한다. <BR>} <BR>openMsgBox(); <BR>//--><BR></script> <BR></head> <BR><body><BR></body><BR></html></FONT></P>
<P> </P>
<P>팝업창인 pop.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><head> <BR><script language="JavaScript"> <BR><!-- <BR>function setcookie( name, value, expiredays ) <BR>{ <BR>var todayDate = new Date(); <BR>todayDate.setDate( todayDate.getDate() + expiredays ); <BR>document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" <BR>} <BR>function closeWin() <BR>{ <BR>if ( document.myform.event.checked ) <BR>setcookie("memo", "no" , 1); // 1일 간 쿠키적용 </FONT></P>
<P><FONT color=#177fcd>} <BR>//--> <BR></script><BR></head> <BR><body onunload="closeWin()"><BR><form name="myform"> <BR><input type="checkbox" name="event">다음부터 이 창을 열지않음 <BR><input type=button value="닫기" onclick="self.close()"> <BR></form> <BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>8.하루동안 팝업창 띄우지 않기 소스 예제2</STRONG></FONT> </FONT></P>
<P>부모창인 index.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><head><BR><SCRIPT LANGUAGE="JavaScript"><BR><!--<BR>function change(form)<BR>{<BR>if (form.url.selectedIndex !=0)<BR>parent.location = form.url.options[form.url.selectedIndex].value<BR>}<BR>function setcookie( name, value, expiredays )<BR>{<BR>var todayDate = new Date();<BR>todayDate.setDate( todayDate.getDate() + expiredays );<BR>document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"<BR>}<BR>function getcookie( name )<BR>{<BR>var nameOfcookie = name + "=";<BR>var x = 0;<BR>while ( x <= document.cookie.length )<BR>{<BR>var y = (x+nameOfcookie.length);<BR>if ( document.cookie.substring( x, y ) == nameOfcookie ) {<BR>if ( (endOfcookie=document.cookie.indexOf( ";", y )) == -1 )<BR>endOfcookie = document.cookie.length;<BR>return unescape( document.cookie.substring( y, endOfcookie ) );<BR>}<BR>x = document.cookie.indexOf( " ", x ) + 1;<BR>if ( x == 0 )<BR>break;<BR>}<BR>return "";<BR>} <BR>if ( getcookie( "Notice" ) != "done" )<BR>{<BR>noticeWindow = window.open('pop.htm','notice','toolbar=no,location=no,directories=no,status=no,<BR>menubar=no,scrollbars=no, resizable=no,width=400,height=400');<BR>//winddow.open의 ()의 것은 한줄에 계속 붙여써야 오류가 안남, 줄바뀌면 오류남<BR>noticeWindow.opener = self;<BR>}<BR>//--><BR></script><BR></head><BR><body><BR></body><BR></html></FONT></P>
<P> </P>
<P>팝업창인 pop.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><head> <BR><SCRIPT language="JavaScript"><BR><!-- <BR>function setcookie( name, value, expiredays )<BR>{<BR>var todayDate = new Date();<BR>todayDate.setDate( todayDate.getDate() + expiredays );<BR>document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"<BR>} </FONT></P>
<P><FONT color=#177fcd></FONT> </P>
<P><FONT color=#177fcd>function closeWin()<BR>{<BR>if ( document.forms[0].Notice.checked )<BR>setcookie( "Notice", "done" , 1); <BR>self.close();<BR>}<BR>//--><BR></script><BR></head><BR><body onunload="closeWin()"><BR><form><BR><input type=CHECKBOX name="Notice" value="">다시 팝업 안뜸<BR><a href="javascript:window.close()">닫기</a><BR></form><BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>9.같은 브라우져에서 팝업 띄우기 않기</STRONG></FONT></P>
<P>부모창인 index.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="javascript"> <BR><!--<BR>function getcookie(name) <BR>{ <BR>var Found = false <BR>var start, end <BR>var i = 0 <BR>// cookie 문자열 전체를 검색 <BR>while(i <= document.cookie.length) <BR>{ <BR>start = i <BR>end = start + name.length <BR>// name과 동일한 문자가 있다면 <BR>if(document.cookie.substring(start, end) == name) <BR>{<BR>Found = true <BR>break <BR>} <BR>i++ <BR>} <BR>// name 문자열을 cookie에서 찾았다면 <BR>if(Found == true) { <BR>start = end + 1 <BR>end = document.cookie.indexOf(";", start) <BR>// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다) <BR>if(end < start) <BR>end = document.cookie.length <BR>// name에 해당하는 value값을 추출하여 리턴한다. <BR>return document.cookie.substring(start, end) <BR>} <BR>// 찾지 못했다면 <BR>return "" <BR>} <BR>function openMsgBox() <BR>{ <BR>var eventcookie=getcookie("memo"); <BR>if (eventcookie != "no") <BR>window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150'); <BR>//팝업창의 주소, 같은 도메인에 있어야 한다. <BR>} <BR>openMsgBox(); <BR>//--><BR></script> <BR></head> <BR><body><BR></body><BR></html> </FONT></P>
<P><BR>팝업창인 pop.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><head> <BR><script language="JavaScript"> <BR><!-- <BR>function setcookie( name, value, expiredays )<BR>{<BR>//같은 창에서만 안띄움.<BR>//expiredays 값은 상관없음.<BR>document.cookie = name + "=" + escape( value ) + "; path=/;";<BR>function closeWin() <BR>{ <BR>if ( document.myform.event.checked ) <BR>setcookie("memo", "no" , 1); // 1일 간 쿠키적용 </FONT></P>
<P><FONT color=#177fcd>} <BR>//--> <BR></script><BR></head> <BR><body onunload="closeWin()"><BR><form name="myform"> <BR><input type="checkbox" name="event">다음부터 이 창을 열지않음 <BR><input type=button value="닫기" onclick="self.close()"> <BR></form> <BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>10.팝업창 가운데에 자동띄우기</STRONG></FONT> </FONT></P>
<P>팝업창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR><!--<BR>function winCentre() {<BR>if (document.layers) {<BR>var sinist = screen.width / 2 - outerWidth / 2;<BR>var toppo = screen.height / 2 - outerHeight / 2;<BR>} else {<BR>var sinist = screen.width / 2 - document.body.offsetWidth / 2;<BR>var toppo = -75 + screen.height / 2 - document.body.offsetHeight / 2;<BR>}<BR>self.moveTo(sinist, toppo);<BR>}<BR>//--><BR></script><BR></head> <BR><body onLoad="winCentre()"><BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>11.부모창에서 클릭하면 팝업창 가운데에 띄우기 </STRONG></FONT></P>
<P>부모창에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><head> <BR><script language="JavaScript"><BR><!-- <BR>var win = null;<BR>function NewWindow(mypage,myname,w,h,scroll){<BR>LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;<BR>TopPosition = (screen.height) ? (screen.height-h)/2 : 0;<BR>settings =<BR>'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',<BR>resizable'<BR>win = window.open(mypage,myname,settings)<BR>} <BR>//--><BR></script> <BR><body><BR><a href="팝업창파일" onclick="NewWindow(this,'name','100','100','yes');return false"><BR>링크</a> <BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>12.같은 브라우져에서만 팝업 띄우기 않기</STRONG></FONT></P>
<P>부모창인 index.htm에 삽입 _새로 브라우져를 열면 팝업창이 뜸<BR><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="javascript"> <BR><!--<BR>function getcookie(name) <BR>{ <BR>var Found = false <BR>var start, end <BR>var i = 0 <BR>// cookie 문자열 전체를 검색 <BR>while(i <= document.cookie.length) <BR>{ <BR>start = i <BR>end = start + name.length <BR>// name과 동일한 문자가 있다면 <BR>if(document.cookie.substring(start, end) == name) <BR>{<BR>Found = true <BR>break <BR>} <BR>i++ <BR>} <BR>// name 문자열을 cookie에서 찾았다면 <BR>if(Found == true) { <BR>start = end + 1 <BR>end = document.cookie.indexOf(";", start) <BR>// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다) <BR>if(end < start) <BR>end = document.cookie.length <BR>// name에 해당하는 value값을 추출하여 리턴한다. <BR>return document.cookie.substring(start, end) <BR>} <BR>// 찾지 못했다면 <BR>return "" <BR>} <BR>function openMsgBox() <BR>{ <BR>var eventcookie=getcookie("memo"); <BR>if (eventcookie != "no") <BR>window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150'); <BR>//팝업창의 주소, 같은 도메인에 있어야 한다. <BR>} <BR>openMsgBox(); <BR>//--><BR></script> <BR></head> <BR><body><BR></body><BR></html> </FONT></P>
<P> </P>
<P>팝업창인 pop.htm에 삽입<BR><FONT color=#177fcd><html><BR><head><BR><title></title><BR><head> <BR><script language="JavaScript"><BR><!--<BR>function setcookie( name, value, expiredays )<BR>{<BR>//같은 창에서만 안띄움.<BR>//expiredays 값은 상관없음.<BR>document.cookie = name + "=" + escape( value ) + "; path=/;";<BR>} <BR>function closeWin()<BR>{<BR>if ( document.myform.event.checked )<BR>setcookie("memo", "no" , 1); // 1일 간 쿠키적용<BR>}<BR>//--><BR></script><BR></head> <BR><body onunload="closeWin()"><BR><form name="myform"> <BR><input type="checkbox" name="event">다음부터 이 창을 열지않음 <BR><input type=button value="닫기" onclick="self.close()"> <BR></form> <BR></body><BR></html> </FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>13.링크걸어서 지정된 사이즈로 열기</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language='JavaScript'> <BR><!-- <BR>function winopen(url)<BR>{ <BR>window.open(url,"url","width=517,height=450,history=no,resizable=no,status=no,<BR>scrollbars=yes,menubar=no");<BR>}<BR>//--><BR></script><BR></head> <BR><body> <BR><a HREF="javascript:winopen('주소')">링크걸기</a><BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>14.자동으로 지정된 크기로 브라우저 열기</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language='JavaScript'> <BR><!-- <BR>window.resizeTo(300,300);<BR>window.moveTo(0,0);<BR>//--><BR></script><BR></head> <BR><body><BR><!--원하는 가로,세로의 크기를 입력해준다.--><BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>15.해상도에 맞추어 전체장으로 늘어남</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR>function winMaximizer() {<BR>if (document.layers) {<BR>larg = screen.availWidth - 10;<BR>altez = screen.availHeight - 20;<BR>} else {<BR>var larg = screen.availWidth;<BR>var altez = screen.availHeight;<BR>}<BR>self.resizeTo(larg, altez);<BR>self.moveTo(0, 0);<BR>}<BR></script><BR></head> <BR><body onload="winMaximizer()"><BR>해상도에 맞추어 전체장으로 늘어남<BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>16.이미지 클릭시 html문서없이 큰이미지로 새창띄우기</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR>var win1Open = null<BR>function displayImage(picName, windowName, <BR>windowWidth, windowHeight){<BR>return window.open(picName,windowName,"toolbar=no, </FONT></P>
<P><FONT color=#177fcd>scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15)) <BR>} function winClose(){<BR>if(win1Open != null) win1Open.close() <BR>} function doNothing(){}<BR></script> <script language="JavaScript1.1"><BR>function displayImage(picName, windowName, </FONT></P>
<P><FONT color=#177fcd>windowWidth, windowHeight){<BR>var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,</FONT></P>
<P><FONT color=#177fcd>resizable=no,width=" + windowWidth + ",height=" + windowHeight)<BR>if(winHandle != null){<BR>var htmlString = "<html><head><title>Picture</title></head>" <BR>htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"<BR>htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0 <BR>alt=닫기></a>"<BR>htmlString += "</body></html>"<BR>winHandle.document.open()<BR>winHandle.document.write(htmlString)<BR>winHandle.document.close()<BR>} <BR>if(winHandle != null) winHandle.focus()<BR>return winHandle<BR>}<BR></script><BR></head> <BR><body><BR><a href="javascript:doNothing()" <BR>onClick="win1Open=displayImage('큰 이미지파일', 'popWin1', '300', '400')" onMouseOver="window.status='Click to display picture'; return true;" onMouseOut="window.status=''"><BR><img src=이미지파일" border="0"></a><BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>17.몇초후 웹페이지이동하기 소스예제1</STRONG></FONT> </FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <BR><script language="JavaScript"><BR>function nextWin()<BR>{location = "이동할 URL"}<BR></script> <BR></head> <BR><body onLoad="setTimeout('nextWin()', 1000)"> <!--1000 이 1초 입니다.--><BR>바로 이동한 원하는 사이트로 이동함<BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>18.몇초후 웹페이지이동하기 소스예제2</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <BR><script language="JavaScript"><BR>self.location.replace('이동할 URL');<BR></script> <BR></head> <BR><body><BR>바로 이동한 원하는 사이트로 이동함<BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399 size=2><STRONG>19.자동새로고침하기</STRONG></FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"> <BR><script language="JavaScript"><BR><!-- <BR>setTimeout("history.go(0);", 3000); // 1초는 1000 입니다. <BR>--> <BR></script> <BR></head> <BR><body><BR>자동새로고침하기<BR></body><BR></html></FONT></P>
<P><BR><FONT color=#ff3399><FONT size=2><STRONG>20.해상도에 따라 다른 웹페이지 열기</STRONG></FONT> </FONT></P>
<P><FONT color=#177fcd><html><BR><head><BR><title>..</title><BR><meta http-equiv="Content-Type" content="text/html; charset=euc-kr"><BR><script language="JavaScript"><BR><!--<BR>function redirectPage() {<BR>var url800x600 = "main1.html"; //800*600 에서 열릴문서<BR>var url1024x768 = "main2.html"; //1024*768 에서 열릴문서<BR>var url1152x864 = "main3.html"; //1152*864 에서 열릴문서 </FONT></P>
<P><FONT color=#177fcd>if ((screen.width == 800) && (screen.height == 600)) <BR>window.location.href= url800x600;<BR>else if ((screen.width == 1024) && (screen.height == 768))<BR>window.location.href= url1024x768;<BR>else if ((screen.width == 1152) && (screen.height == 864))<BR>window.location.href= url1152x864;<BR>else window.location.href= url800x600;<BR>}<BR>//--> <BR></script><BR></head> <BR><body Onload="redirectPage()"> <BR></body><BR></html></FONT></P>
<P><FONT color=#177fcd></FONT> </P>
<P><FONT color=#ff3399 size=2><STRONG>30.HTML파일 없이 이미지 사이즈에 맞게 팝업창 띄우기.<BR></STRONG></FONT><FONT color=#177fcd><script Language="Javascript"><BR><!-- //////////////////////////////////////////////////////////////<BR>//*****************************************************************<BR>// Web Site: </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ </FONT><A class=con_link href="mailto:webmaster@CginJs.Com" target=_blank><FONT color=#177fcd><U>webmaster@CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// C.n.J 자바스크립트 자동 생성 마법사 ☞ </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// C.n.J 자바스크립트(JavaScript) 가이드 ☞ </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// C.n.J CSS(Cascading Style Sheet) 가이드 ☞ </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>// Editer : Web Site: </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.CginJs.Com</U></FONT></A><BR><FONT color=#177fcd>//*****************************************************************<BR>/////////////////////////////////////////////////////////////// --><BR>var cnj_img_view = null;<BR>function cnj_win_view(img){<BR>img_conf1= new Image();<BR>img_conf1.src=(img);<BR>cnj_view_conf(img);<BR>}</FONT></P>
<P><FONT color=#177fcd>function cnj_view_conf(img){<BR>if((img_conf1.width!=0)&&(img_conf1.height!=0)){<BR>cnj_view_img(img);<BR>} else {<BR>funzione="cnj_view_conf('"+img+"')";<BR>intervallo=setTimeout(funzione,20);<BR>}<BR>}</FONT></P>
<P><FONT color=#177fcd>function cnj_view_img(img){<BR>if(cnj_img_view != null) {<BR>if(!cnj_img_view.closed) { cnj_img_view.close(); }<BR>}<BR>cnj_width=img_conf1.width+20;<BR>cnj_height=img_conf1.height+20;<BR>str_img="width="+cnj_width+",height="+cnj_height;<BR>cnj_img_view=window.open(img,"cnj_img_open",str_img);<BR>cnj_img_view.focus();<BR>return;<BR>}<BR></script></FONT></P>
<P><FONT color=#177fcd></FONT> </P>
<P><FONT color=#177fcd><a href="javascript:cnj_win_view('../img/cnjlogo.gif')"><img src="../img/cnjlogo.gif" border="0" width="247" height="55"></a></FONT></P>
<P><FONT color=#177fcd>32.이미지사이즈에 맞게 새창이 열리며 휠마우스 효과를 내줌<BR>그리고 메인(imgmove-main.html)에서 새창 띄워주는 부분</FONT></P>
<P><FONT color=#177fcd><SCRIPT LANGUAGE="JavaScript"><BR><!-- Begin<BR>function cnjOpen() {<BR>window.open('img-move.html','cnjOpenWin','width=350,height=250,toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0');<BR>} <BR>// End --><BR></script><BR><a href="javascript:cnjOpen()"><img src="test.jpg" width="200" height="150" border="0"></a><BR></center></FONT></P>
<P><FONT color=#177fcd>이 부분은 이미지를 보여줄 새창(img-move.html)입니다.<BR><style><BR>body {cursor:move;}<BR></style><BR><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad="fitWindowSize();"></FONT></P>
<P><FONT color=#177fcd><SCRIPT LANGUAGE="JavaScript"><BR>// 이미지는 별도로 제공하지 않습니다.<BR><!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ </FONT><A class=con_link href="http://www.cginjs.com/" target=_blank><FONT color=#177fcd><U>http://www.cginjs.com</U></FONT></A><FONT color=#177fcd> --><BR><!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ </FONT><A class=con_link href="mailto:webmaster@cginjs.com" target=_blank><FONT color=#177fcd><U>webmaster@cginjs.com</U></FONT></A><FONT color=#177fcd> --><BR>var ie = 1;<BR>var windowX, windowY;<BR>var bLargeImage = 0;<BR>var x,y;</FONT></P>
<P><FONT color=#177fcd>var InitX = 500;</FONT></P>
<P><FONT color=#177fcd>// 이미지가 새창에 맞게 조절되는 부분</FONT></P>
<P><FONT color=#177fcd>function fitWindowSize() <BR>{<BR>if( ie )<BR>{<BR>window.resizeTo( InitX, InitX );<BR>width = InitX - (document.body.clientWidth - document.images[0].width);<BR>height = InitX - (document.body.clientHeight - document.images[0].height);<BR>windowX = (window.screen.width-width)/2;<BR>windowY = (window.screen.height-height)/2;<BR>if( width > screen.width-50 )<BR>{<BR>width = screen.width-50;<BR>windowX = 20;<BR>bLargeImage = 1;<BR>}<BR>if( height > screen.height-80 )<BR>{<BR>height = screen.height-80;<BR>windowY = 20;<BR>bLargeImage = 1;<BR>}<BR>window.moveTo( windowX, windowY );<BR>window.resizeTo( width, height+4 );<BR>}<BR>else<BR>{<BR>window.innerWidth = document.layers[0].document.images[0].width;<BR>window.innerHeight = document.layers[0].document.images[0].height;<BR>}<BR>}</FONT></P>
<P><FONT color=#177fcd>// 휠마우스 효과</FONT></P>
<P><FONT color=#177fcd>function move() {<BR>if(bLargeImage){ window.scroll(window.event.clientX - 50,window.event.clientY -50);<BR>}<BR>}</FONT></P>
<P><FONT color=#177fcd>// 오른쪽 왼쪽 마우스 클릭시 창닫는 부분</FONT></P>
<P><FONT color=#177fcd>function click() { <BR>if ((event.button==1) || (event.button==2) || (event.button==3)) {<BR>top.self.close();<BR>}<BR>}<BR>document.onmousedown=click</FONT></P>
<P><FONT color=#177fcd></script><BR><img src="</FONT><A class=con_link href="http://www.cginjs.com/cgi/js/test.jpg" target=_blank><FONT color=#177fcd><U>http://www.cginjs.com/cgi/js/test.jpg</U></FONT></A><FONT color=#177fcd>" border="0" ONMOUSEMOVE="move();"> </FONT></P>
<P><FONT color=#177fcd></FONT> </P>
<P><FONT color=#177fcd></FONT> </P></SPAN>

의견 1 자료등록      목록