새창(팝업) 가로/세로 크기 조절
인터넷정보2007. 10. 18. 14:16
<script>
window.resizeTo (350,450); // 기본 크기 세팅
var isOpenWindow=false;
function reSize1() { // 세로로 크기 조절
if (!isOpenWindow) {
parent.resizeTo(350, 700); //펼쳐졌을때의 크기
isOpenWindow=true;
} else {
parent.resizeTo(350, 450); //작아졌을때의 크기
isOpenWindow=false;
}
}
function reSize2() { // 가로로 크기 조절
if (!isOpenWindow) {
parent.resizeTo(600, 450); //펼쳐졌을때의 크기
isOpenWindow=true;
} else {
parent.resizeTo(350, 450); //작아졌을때의 크기
isOpenWindow=false;
}
}
</script>
<span onClick="javascript:reSize1();" style="cursor:hand;font-size:9pt;">세로</span> |
<span onClick="javascript:reSize2();" style="cursor:hand;font-size:9pt;">가로</span>
또는........................
띄워지는 문서... 새창 바디 태그에 넣으세요.
<body onresize="parent.resizeTo(630,460);" onload="parent.resizeTo(630,460);">
또는...
<script>
window.resizeTo (630,460); // 새창 크기 조절
window.moveTo(300,200); // 새창 위치 (좌,상단)
</script>
window.resizeTo (350,450); // 기본 크기 세팅
var isOpenWindow=false;
function reSize1() { // 세로로 크기 조절
if (!isOpenWindow) {
parent.resizeTo(350, 700); //펼쳐졌을때의 크기
isOpenWindow=true;
} else {
parent.resizeTo(350, 450); //작아졌을때의 크기
isOpenWindow=false;
}
}
function reSize2() { // 가로로 크기 조절
if (!isOpenWindow) {
parent.resizeTo(600, 450); //펼쳐졌을때의 크기
isOpenWindow=true;
} else {
parent.resizeTo(350, 450); //작아졌을때의 크기
isOpenWindow=false;
}
}
</script>
<span onClick="javascript:reSize1();" style="cursor:hand;font-size:9pt;">세로</span> |
<span onClick="javascript:reSize2();" style="cursor:hand;font-size:9pt;">가로</span>
또는........................
띄워지는 문서... 새창 바디 태그에 넣으세요.
<body onresize="parent.resizeTo(630,460);" onload="parent.resizeTo(630,460);">
또는...
<script>
window.resizeTo (630,460); // 새창 크기 조절
window.moveTo(300,200); // 새창 위치 (좌,상단)
</script>
'인터넷정보' 카테고리의 다른 글
유니코드, 아스키코드 (0) | 2007.10.18 |
---|---|
첫번째 체크박스에서 두번째 체크박스를 제어하는 스크립트 (0) | 2007.10.18 |
체크된 라디오 값 가져오기 (0) | 2007.10.18 |
아라비아 숫자를 한글로... (0) | 2007.10.18 |
인풋 태그에 글쓰기 (0) | 2007.10.18 |
입력 상자 증가 폼 (0) | 2007.10.18 |
막대 그래프 동적으로 보여주기 (0) | 2007.10.18 |
XP 서비스팩2 팝업 대체용 공지 - 레이어이용, 쿠키 (0) | 2007.10.18 |
아이프레임을 드래그 해보자. (0) | 2007.10.18 |
본문 내용 글씨를 폰트 크기, 지정폰트, 축소, 확대 하기 (0) | 2007.10.18 |
팝업창에 관한 모든것(새창)
인터넷정보2007. 10. 18. 14:02
기본형
1. 옵션을 HEAD안에...
<script language="JavaScript">
function openNewWindow(window) {
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");
}
</script>
<a href=javascript:openNewWindow("주소입력")>새창열기</a>
2. 링크에 옵션을 지정...
<a href="javascript:;" onclick="window.open('주소입력','name','resizable=no width=200 height=200');return false">새창열기</a>
* 옵션 *
새창 뛰울때 용도에 맞게 옵션 설정을 해줍니다. "YES" 또는 "NO" 로 지정 해주면 됩니다.
menubar - 파일, 편집, 보기....부분
toolbar - 뒤로, 앞으로, 새로고침 아이콘등이 있는 부분
directories - 연결 디렉토리가 표시되는 부분
location - 주소 입력창
status - 아래 브라우저 상태 바
scrollbars - 스크롤
resizable - 리사이즈 옵션
1.자동 띄우기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="javascript">
<!--
function pop(){
window.open("팝업창파일", "pop", "width=400,height=500,history=no,resizable=no,status=no,scrollbars=yes,menubar=no")
}
//-->
</script>
</head>
<body onload="javascript:pop()">
이벤트 팝업창을 띄우기
</body>
</html>
2.프레임이 있는 팝업창 닫기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="Javascript">
<!--
function frameclose() {
parent.close()
window.close()
self.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:frameclose()">프레임셋 한방에 닫기</a>
</body>
</html>
3.팝업창 닫고 프레임이 없는 부모창에서 원하는 페이지로 이동하기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="javascript">
<!--
function MovePage() {
window.opener.top.location.href="연결할파일"
window.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:MovePage();">자세한내용보기</a>
</body>
</html>
4.팝업창 닫고 프레임이 있는 부모창에서 원하는 페이지로 이동하기
팝업창에 삽입하고 팝업창의 설정은 프레임셋 페이지에 해야함
오픈창이 아닐경우에는 window.top.프레임이름.location.href="연결할파일" 적용한다
<html>
<head>
<title></title>
<script language="javascript">
<!--
function MovePage() {
window.opener.top.프레임이름.location.href="연결할파일"
//팝업창이 아닌것우..
window.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:MovePage();">자세한내용보기</a>
</body>
</html>
5.팝업창 자동으로 닫기
팝업창에 삽입
<html>
<head>
<title>Close Window Timer</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function closeWin(thetime) {
setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.
}
//-->
</script>
</head>
<body onLoad="closeWin('5000')">
이창은 5초후 자동으로 창이 닫힘니다.<br>
</body>
</html>
6.프레임 나눈 팝업창 한번에 닫기
팝업창에 삽입
<html>
<head>
<title>Close Window Timer</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function closeWin(thetime) {
setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.
}
//-->
</script>
</head>
<body onLoad="closeWin('5000')">
이창은 5초후 자동으로 창이 닫힘니다.<br>
</body>
</html>
7.하루동안 팝업창 띄우지 않기 소스 예제1
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<A onclick="javascript:document.all.event.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
8.하루동안 팝업창 띄우지 않기 소스 예제2
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function change(form)
{
if (form.url.selectedIndex !=0)
parent.location = form.url.options[form.url.selectedIndex].value
}
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( 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 "";
}
if ( getCookie( "Notice" ) != "done" )
{
noticeWindow = window.open('pop.htm','notice','toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=no, resizable=no,width=400,height=400');
//winddow.open의 ()의 것은 한줄에 계속 붙여써야 오류가 안남, 줄바뀌면 오류남
noticeWindow.opener = self;
}
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<SCRIPT language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin()
{
if ( document.forms[0].Notice.checked )
setCookie( "Notice", "done" , 1);
self.close();
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form>
<A onclick="javascript:document.all.Notice.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type=CHECKBOX name="Notice" value="">다시 팝업 안뜸
<a href="javascript:window.close()">닫기</a>
</form>
</body>
</html>
9.같은 브라우져에서 팝업 띄우기 않기
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
//같은 창에서만 안띄움.
//expiredays 값은 상관없음.
document.cookie = name + "=" + escape( value ) + "; path=/;";
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<A onclick="javascript:document.all.event.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
10.팝업창 가운데에 자동띄우기
팝업창에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function winCentre() {
if (document.layers) {
var sinist = screen.width / 2 - outerWidth / 2;
var toppo = screen.height / 2 - outerHeight / 2;
} else {
var sinist = screen.width / 2 - document.body.offsetWidth / 2;
var toppo = -75 + screen.height / 2 - document.body.offsetHeight / 2;
}
self.moveTo(sinist, toppo);
}
//-->
</script>
</head>
<body onLoad="winCentre()">
</body>
</html>
11.부모창에서 클릭하면 팝업창 가운데에 띄우기
부모창에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',
resizable'
win = window.open(mypage,myname,settings)
}
//-->
</script>
<body>
<a href="팝업창파일" onclick="NewWindow(this,'name','100','100','yes');return false">
링크</a>
</body>
</html>
12.같은 브라우져에서만 팝업 띄우기 않기
부모창인 index.htm에 삽입 _새로 브라우져를 열면 팝업창이 뜸
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
//같은 창에서만 안띄움.
//expiredays 값은 상관없음.
document.cookie = name + "=" + escape( value ) + "; path=/;";
}
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
13.링크걸어서 지정된 사이즈로 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language='JavaScript'>
<!--
function winopen(url)
{
window.open(url,"url","width=517,height=450,history=no,resizable=no,status=no,
scrollbars=yes,menubar=no");
}
//-->
</script>
</head>
<body>
<a HREF="javascript:winopen('주소')">링크걸기</a>
</body>
</html>
14.자동으로 지정된 크기로 브라우저 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language='JavaScript'>
<!--
window.resizeTo(300,300);
window.moveTo(0,0);
//-->
</script>
</head>
<body>
<!--원하는 가로,세로의 크기를 입력해준다.-->
</body>
</html>
15.해상도에 맞추어 전체장으로 늘어남
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
function winMaximizer() {
if (document.layers) {
larg = screen.availWidth - 10;
altez = screen.availHeight - 20;
} else {
var larg = screen.availWidth;
var altez = screen.availHeight;
}
self.resizeTo(larg, altez);
self.moveTo(0, 0);
}
</script>
</head>
<body onload="winMaximizer()">
해상도에 맞추어 전체장으로 늘어남
</body>
</html>
16.이미지 클릭시 html문서없이 큰이미지로 새창띄우기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
var win1Open = null
function displayImage(picName, windowName,
windowWidth, windowHeight){
return window.open(picName,windowName,"toolbar=no,
scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15))
} function winClose(){
if(win1Open != null) win1Open.close()
} function doNothing(){}
</script> <script language="JavaScript1.1">
function displayImage(picName, windowName,
windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,
resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>"
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0
alt=닫기></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
}
if(winHandle != null) winHandle.focus()
return winHandle
}
</script>
</head>
<body>
<a href="javascript:doNothing()"
onClick="win1Open=displayImage('큰 이미지파일', 'popWin1', '300', '400')" onMouseOver="window.status='Click to display picture'; return true;" onMouseOut="window.status=''">
<img src=이미지파일" border="0"></a>
</body>
</html>
17.몇초후 웹페이지이동하기 소스예제1
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
function nextWin()
{location = "이동할 URL"}
</script>
</head>
<body onLoad="setTimeout('nextWin()', 1000)"> <!--1000 이 1초 입니다.-->
바로 이동한 원하는 사이트로 이동함
</body>
</html>
18.몇초후 웹페이지이동하기 소스예제2
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
self.location.replace('이동할 URL');
</script>
</head>
<body>
바로 이동한 원하는 사이트로 이동함
</body>
</html>
19.자동새로고침하기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
setTimeout("history.go(0);", 3000); // 1초는 1000 입니다.
-->
</script>
</head>
<body>
자동새로고침하기
</body>
</html>
20.해상도에 따라 다른 웹페이지 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function redirectPage() {
var url800x600 = "main1.html"; //800*600 에서 열릴문서
var url1024x768 = "main2.html"; //1024*768 에서 열릴문서
var url1152x864 = "main3.html"; //1152*864 에서 열릴문서
if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else if ((screen.width == 1152) && (screen.height == 864))
window.location.href= url1152x864;
else window.location.href= url800x600;
}
//-->
</script>
</head>
<body Onload="redirectPage()">
</body>
</html>
30.HTML파일 없이 이미지 사이즈에 맞게 팝업창 띄우기.
<script Language="Javascript">
<!-- //////////////////////////////////////////////////////////////
//*****************************************************************
// Web Site: http://www.CginJs.Com
// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ http://www.CginJs.Com
// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ webmaster@CginJs.Com
// C.n.J 자바스크립트 자동 생성 마법사 ☞ http://www.CginJs.Com
// C.n.J 자바스크립트(JavaScript) 가이드 ☞ http://www.CginJs.Com
// C.n.J CSS(Cascading Style Sheet) 가이드 ☞ http://www.CginJs.Com
// Editer : Web Site: http://www.CginJs.Com
//*****************************************************************
/////////////////////////////////////////////////////////////// -->
var cnj_img_view = null;
function cnj_win_view(img){
img_conf1= new Image();
img_conf1.src=(img);
cnj_view_conf(img);
}
function cnj_view_conf(img){
if((img_conf1.width!=0)&&(img_conf1.height!=0)){
cnj_view_img(img);
} else {
funzione="cnj_view_conf('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}
function cnj_view_img(img){
if(cnj_img_view != null) {
if(!cnj_img_view.closed) { cnj_img_view.close(); }
}
cnj_width=img_conf1.width+20;
cnj_height=img_conf1.height+20;
str_img="width="+cnj_width+",height="+cnj_height;
cnj_img_view=window.open(img,"cnj_img_open",str_img);
cnj_img_view.focus();
return;
}
</script>
<a href="javascript:cnj_win_view('../img/cnjlogo.gif')"><img src="../img/cnjlogo.gif" border="0" width="247" height="55"></a>
32.이미지사이즈에 맞게 새창이 열리며 휠마우스 효과를 내줌
그리고 메인(imgmove-main.html)에서 새창 띄워주는 부분
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function cnjOpen() {
window.open('img-move.html','cnjOpenWin','width=350,height=250,toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0');
}
// End -->
</script>
<a href="javascript:cnjOpen()"><img src="test.jpg" width="200" height="150" border="0"></a>
</center>
이 부분은 이미지를 보여줄 새창(img-move.html)입니다.
<style>
body {cursor:move;}
</style>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad="fitWindowSize();">
<SCRIPT LANGUAGE="JavaScript">
// 이미지는 별도로 제공하지 않습니다.
<!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ http://www.cginjs.com -->
<!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ webmaster@cginjs.com -->
var ie = 1;
var windowX, windowY;
var bLargeImage = 0;
var x,y;
var InitX = 500;
// 이미지가 새창에 맞게 조절되는 부분
function fitWindowSize()
{
if( ie )
{
window.resizeTo( InitX, InitX );
width = InitX - (document.body.clientWidth - document.images[0].width);
height = InitX - (document.body.clientHeight - document.images[0].height);
windowX = (window.screen.width-width)/2;
windowY = (window.screen.height-height)/2;
if( width > screen.width-50 )
{
width = screen.width-50;
windowX = 20;
bLargeImage = 1;
}
if( height > screen.height-80 )
{
height = screen.height-80;
windowY = 20;
bLargeImage = 1;
}
window.moveTo( windowX, windowY );
window.resizeTo( width, height+4 );
}
else
{
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
}
// 휠마우스 효과
function move() {
if(bLargeImage){ window.scroll(window.event.clientX - 50,window.event.clientY -50);
}
}
// 오른쪽 왼쪽 마우스 클릭시 창닫는 부분
function click() {
if ((event.button==1) || (event.button==2) || (event.button==3)) {
top.self.close();
}
}
document.onmousedown=click
</script>
<img src="http://www.cginjs.com/cgi/js/test.jpg" border="0" ONMOUSEMOVE="move();">
1. 옵션을 HEAD안에...
<script language="JavaScript">
function openNewWindow(window) {
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");
}
</script>
<a href=javascript:openNewWindow("주소입력")>새창열기</a>
2. 링크에 옵션을 지정...
<a href="javascript:;" onclick="window.open('주소입력','name','resizable=no width=200 height=200');return false">새창열기</a>
* 옵션 *
새창 뛰울때 용도에 맞게 옵션 설정을 해줍니다. "YES" 또는 "NO" 로 지정 해주면 됩니다.
menubar - 파일, 편집, 보기....부분
toolbar - 뒤로, 앞으로, 새로고침 아이콘등이 있는 부분
directories - 연결 디렉토리가 표시되는 부분
location - 주소 입력창
status - 아래 브라우저 상태 바
scrollbars - 스크롤
resizable - 리사이즈 옵션
1.자동 띄우기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="javascript">
<!--
function pop(){
window.open("팝업창파일", "pop", "width=400,height=500,history=no,resizable=no,status=no,scrollbars=yes,menubar=no")
}
//-->
</script>
</head>
<body onload="javascript:pop()">
이벤트 팝업창을 띄우기
</body>
</html>
2.프레임이 있는 팝업창 닫기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="Javascript">
<!--
function frameclose() {
parent.close()
window.close()
self.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:frameclose()">프레임셋 한방에 닫기</a>
</body>
</html>
3.팝업창 닫고 프레임이 없는 부모창에서 원하는 페이지로 이동하기
팝업창에 삽입
<html>
<head>
<title></title>
<script language="javascript">
<!--
function MovePage() {
window.opener.top.location.href="연결할파일"
window.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:MovePage();">자세한내용보기</a>
</body>
</html>
4.팝업창 닫고 프레임이 있는 부모창에서 원하는 페이지로 이동하기
팝업창에 삽입하고 팝업창의 설정은 프레임셋 페이지에 해야함
오픈창이 아닐경우에는 window.top.프레임이름.location.href="연결할파일" 적용한다
<html>
<head>
<title></title>
<script language="javascript">
<!--
function MovePage() {
window.opener.top.프레임이름.location.href="연결할파일"
//팝업창이 아닌것우..
window.close()
}
//-->
</script>
</head>
<body>
<a href="javascript:MovePage();">자세한내용보기</a>
</body>
</html>
5.팝업창 자동으로 닫기
팝업창에 삽입
<html>
<head>
<title>Close Window Timer</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function closeWin(thetime) {
setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.
}
//-->
</script>
</head>
<body onLoad="closeWin('5000')">
이창은 5초후 자동으로 창이 닫힘니다.<br>
</body>
</html>
6.프레임 나눈 팝업창 한번에 닫기
팝업창에 삽입
<html>
<head>
<title>Close Window Timer</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function closeWin(thetime) {
setTimeout("window.close()", thetime); //1000 은 1초를 의미합니다.
}
//-->
</script>
</head>
<body onLoad="closeWin('5000')">
이창은 5초후 자동으로 창이 닫힘니다.<br>
</body>
</html>
7.하루동안 팝업창 띄우지 않기 소스 예제1
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<A onclick="javascript:document.all.event.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
8.하루동안 팝업창 띄우지 않기 소스 예제2
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function change(form)
{
if (form.url.selectedIndex !=0)
parent.location = form.url.options[form.url.selectedIndex].value
}
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( 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 "";
}
if ( getCookie( "Notice" ) != "done" )
{
noticeWindow = window.open('pop.htm','notice','toolbar=no,location=no,directories=no,status=no,
menubar=no,scrollbars=no, resizable=no,width=400,height=400');
//winddow.open의 ()의 것은 한줄에 계속 붙여써야 오류가 안남, 줄바뀌면 오류남
noticeWindow.opener = self;
}
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<SCRIPT language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin()
{
if ( document.forms[0].Notice.checked )
setCookie( "Notice", "done" , 1);
self.close();
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form>
<A onclick="javascript:document.all.Notice.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type=CHECKBOX name="Notice" value="">다시 팝업 안뜸
<a href="javascript:window.close()">닫기</a>
</form>
</body>
</html>
9.같은 브라우져에서 팝업 띄우기 않기
부모창인 index.htm에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
//같은 창에서만 안띄움.
//expiredays 값은 상관없음.
document.cookie = name + "=" + escape( value ) + "; path=/;";
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<A onclick="javascript:document.all.event.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
10.팝업창 가운데에 자동띄우기
팝업창에 삽입
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function winCentre() {
if (document.layers) {
var sinist = screen.width / 2 - outerWidth / 2;
var toppo = screen.height / 2 - outerHeight / 2;
} else {
var sinist = screen.width / 2 - document.body.offsetWidth / 2;
var toppo = -75 + screen.height / 2 - document.body.offsetHeight / 2;
}
self.moveTo(sinist, toppo);
}
//-->
</script>
</head>
<body onLoad="winCentre()">
</body>
</html>
11.부모창에서 클릭하면 팝업창 가운데에 띄우기
부모창에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',
resizable'
win = window.open(mypage,myname,settings)
}
//-->
</script>
<body>
<a href="팝업창파일" onclick="NewWindow(this,'name','100','100','yes');return false">
링크</a>
</body>
</html>
12.같은 브라우져에서만 팝업 띄우기 않기
부모창인 index.htm에 삽입 _새로 브라우져를 열면 팝업창이 뜸
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="javascript">
<!--
function getCookie(name)
{
var Found = false
var start, end
var i = 0
// cookie 문자열 전체를 검색
while(i <= document.cookie.length)
{
start = i
end = start + name.length
// name과 동일한 문자가 있다면
if(document.cookie.substring(start, end) == name)
{
Found = true
break
}
i++
}
// name 문자열을 cookie에서 찾았다면
if(Found == true) {
start = end + 1
end = document.cookie.indexOf(";", start)
// 마지막 부분이라 는 것을 의미(마지막에는 ";"가 없다)
if(end < start)
end = document.cookie.length
// name에 해당하는 value값을 추출하여 리턴한다.
return document.cookie.substring(start, end)
}
// 찾지 못했다면
return ""
}
function openMsgBox()
{
var eventCookie=getCookie("memo");
if (eventCookie != "no")
window.open('팝업창파일','_blank','width=300,height=300,top=50,left=150');
//팝업창의 주소, 같은 도메인에 있어야 한다.
}
openMsgBox();
//-->
</script>
</head>
<body>
</body>
</html>
팝업창인 pop.htm에 삽입
<html>
<head>
<title></title>
<head>
<script language="JavaScript">
<!--
function setCookie( name, value, expiredays )
{
//같은 창에서만 안띄움.
//expiredays 값은 상관없음.
document.cookie = name + "=" + escape( value ) + "; path=/;";
}
function closeWin()
{
if ( document.myform.event.checked )
setCookie("memo", "no" , 1); // 1일 간 쿠키적용
}
//-->
</script>
</head>
<body onunload="closeWin()">
<form name="myform">
<input type="checkbox" name="event">다음부터 이 창을 열지않음
<input type=button value="닫기" onclick="self.close()">
</form>
</body>
</html>
13.링크걸어서 지정된 사이즈로 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language='JavaScript'>
<!--
function winopen(url)
{
window.open(url,"url","width=517,height=450,history=no,resizable=no,status=no,
scrollbars=yes,menubar=no");
}
//-->
</script>
</head>
<body>
<a HREF="javascript:winopen('주소')">링크걸기</a>
</body>
</html>
14.자동으로 지정된 크기로 브라우저 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language='JavaScript'>
<!--
window.resizeTo(300,300);
window.moveTo(0,0);
//-->
</script>
</head>
<body>
<!--원하는 가로,세로의 크기를 입력해준다.-->
</body>
</html>
15.해상도에 맞추어 전체장으로 늘어남
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
function winMaximizer() {
if (document.layers) {
larg = screen.availWidth - 10;
altez = screen.availHeight - 20;
} else {
var larg = screen.availWidth;
var altez = screen.availHeight;
}
self.resizeTo(larg, altez);
self.moveTo(0, 0);
}
</script>
</head>
<body onload="winMaximizer()">
해상도에 맞추어 전체장으로 늘어남
</body>
</html>
16.이미지 클릭시 html문서없이 큰이미지로 새창띄우기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
var win1Open = null
function displayImage(picName, windowName,
windowWidth, windowHeight){
return window.open(picName,windowName,"toolbar=no,
scrollbars=no,resizable=no,width=" + (parseInt(windowWidth)+20) + ",height=" + (parseInt(windowHeight)+15))
} function winClose(){
if(win1Open != null) win1Open.close()
} function doNothing(){}
</script> <script language="JavaScript1.1">
function displayImage(picName, windowName,
windowWidth, windowHeight){
var winHandle = window.open("" ,windowName,"toolbar=no,scrollbars=no,
resizable=no,width=" + windowWidth + ",height=" + windowHeight)
if(winHandle != null){
var htmlString = "<html><head><title>Picture</title></head>"
htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
htmlString += "<a href=javascript:window.close()><img src=" + picName + " border=0
alt=닫기></a>"
htmlString += "</body></html>"
winHandle.document.open()
winHandle.document.write(htmlString)
winHandle.document.close()
}
if(winHandle != null) winHandle.focus()
return winHandle
}
</script>
</head>
<body>
<a href="javascript:doNothing()"
onClick="win1Open=displayImage('큰 이미지파일', 'popWin1', '300', '400')" onMouseOver="window.status='Click to display picture'; return true;" onMouseOut="window.status=''">
<img src=이미지파일" border="0"></a>
</body>
</html>
17.몇초후 웹페이지이동하기 소스예제1
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
function nextWin()
{location = "이동할 URL"}
</script>
</head>
<body onLoad="setTimeout('nextWin()', 1000)"> <!--1000 이 1초 입니다.-->
바로 이동한 원하는 사이트로 이동함
</body>
</html>
18.몇초후 웹페이지이동하기 소스예제2
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
self.location.replace('이동할 URL');
</script>
</head>
<body>
바로 이동한 원하는 사이트로 이동함
</body>
</html>
19.자동새로고침하기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
setTimeout("history.go(0);", 3000); // 1초는 1000 입니다.
-->
</script>
</head>
<body>
자동새로고침하기
</body>
</html>
20.해상도에 따라 다른 웹페이지 열기
<html>
<head>
<title>..</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function redirectPage() {
var url800x600 = "main1.html"; //800*600 에서 열릴문서
var url1024x768 = "main2.html"; //1024*768 에서 열릴문서
var url1152x864 = "main3.html"; //1152*864 에서 열릴문서
if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else if ((screen.width == 1152) && (screen.height == 864))
window.location.href= url1152x864;
else window.location.href= url800x600;
}
//-->
</script>
</head>
<body Onload="redirectPage()">
</body>
</html>
30.HTML파일 없이 이미지 사이즈에 맞게 팝업창 띄우기.
<script Language="Javascript">
<!-- //////////////////////////////////////////////////////////////
//*****************************************************************
// Web Site: http://www.CginJs.Com
// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ http://www.CginJs.Com
// CGI 와 JavaScript가 만났을 때 = C.n.J ☞ webmaster@CginJs.Com
// C.n.J 자바스크립트 자동 생성 마법사 ☞ http://www.CginJs.Com
// C.n.J 자바스크립트(JavaScript) 가이드 ☞ http://www.CginJs.Com
// C.n.J CSS(Cascading Style Sheet) 가이드 ☞ http://www.CginJs.Com
// Editer : Web Site: http://www.CginJs.Com
//*****************************************************************
/////////////////////////////////////////////////////////////// -->
var cnj_img_view = null;
function cnj_win_view(img){
img_conf1= new Image();
img_conf1.src=(img);
cnj_view_conf(img);
}
function cnj_view_conf(img){
if((img_conf1.width!=0)&&(img_conf1.height!=0)){
cnj_view_img(img);
} else {
funzione="cnj_view_conf('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}
function cnj_view_img(img){
if(cnj_img_view != null) {
if(!cnj_img_view.closed) { cnj_img_view.close(); }
}
cnj_width=img_conf1.width+20;
cnj_height=img_conf1.height+20;
str_img="width="+cnj_width+",height="+cnj_height;
cnj_img_view=window.open(img,"cnj_img_open",str_img);
cnj_img_view.focus();
return;
}
</script>
<a href="javascript:cnj_win_view('../img/cnjlogo.gif')"><img src="../img/cnjlogo.gif" border="0" width="247" height="55"></a>
32.이미지사이즈에 맞게 새창이 열리며 휠마우스 효과를 내줌
그리고 메인(imgmove-main.html)에서 새창 띄워주는 부분
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function cnjOpen() {
window.open('img-move.html','cnjOpenWin','width=350,height=250,toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0');
}
// End -->
</script>
<a href="javascript:cnjOpen()"><img src="test.jpg" width="200" height="150" border="0"></a>
</center>
이 부분은 이미지를 보여줄 새창(img-move.html)입니다.
<style>
body {cursor:move;}
</style>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad="fitWindowSize();">
<SCRIPT LANGUAGE="JavaScript">
// 이미지는 별도로 제공하지 않습니다.
<!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ http://www.cginjs.com -->
<!-- CGI 와 JavaScript가 만났을 때=CnJ ☞ webmaster@cginjs.com -->
var ie = 1;
var windowX, windowY;
var bLargeImage = 0;
var x,y;
var InitX = 500;
// 이미지가 새창에 맞게 조절되는 부분
function fitWindowSize()
{
if( ie )
{
window.resizeTo( InitX, InitX );
width = InitX - (document.body.clientWidth - document.images[0].width);
height = InitX - (document.body.clientHeight - document.images[0].height);
windowX = (window.screen.width-width)/2;
windowY = (window.screen.height-height)/2;
if( width > screen.width-50 )
{
width = screen.width-50;
windowX = 20;
bLargeImage = 1;
}
if( height > screen.height-80 )
{
height = screen.height-80;
windowY = 20;
bLargeImage = 1;
}
window.moveTo( windowX, windowY );
window.resizeTo( width, height+4 );
}
else
{
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
}
// 휠마우스 효과
function move() {
if(bLargeImage){ window.scroll(window.event.clientX - 50,window.event.clientY -50);
}
}
// 오른쪽 왼쪽 마우스 클릭시 창닫는 부분
function click() {
if ((event.button==1) || (event.button==2) || (event.button==3)) {
top.self.close();
}
}
document.onmousedown=click
</script>
<img src="http://www.cginjs.com/cgi/js/test.jpg" border="0" ONMOUSEMOVE="move();">
'인터넷정보' 카테고리의 다른 글
PNG 그림파일 알파값 살리기 (0) | 2007.10.18 |
---|---|
텍스트 밑줄 긋기 (0) | 2007.10.18 |
글쓰기폼 늘리기 - 확장, 축소 (0) | 2007.10.18 |
해상도에따른 브라우저 크기조절 (0) | 2007.10.18 |
투명한 textarea (0) | 2007.10.18 |
필터 효과 (0) | 2007.10.18 |
스포트라이트 효과 (0) | 2007.10.18 |
이미지 안쓰고 모서리(테두리) 둥근 테이블 만들기 (0) | 2007.10.18 |
이미지에 마우스 올리면 선명해지게 (0) | 2007.10.18 |
이미지 웨이브 (0) | 2007.10.18 |
새창 가운데 띄우기
인터넷정보2007. 10. 18. 13:49
<Script Language=javascript>
pw = (screen.availWidth - window.document.body.clientWidth) /2;
ph = (screen.availHeight - window.document.body.clientHeight) /2;
window.moveTo(pw,ph);
</Script>
위 소스를 문서 </body> 바로 위에 넣으세요.
pw = (screen.availWidth - window.document.body.clientWidth) /2;
ph = (screen.availHeight - window.document.body.clientHeight) /2;
window.moveTo(pw,ph);
</Script>
위 소스를 문서 </body> 바로 위에 넣으세요.
'인터넷정보' 카테고리의 다른 글
iframe 리로드 시키기 (0) | 2007.10.18 |
---|---|
자바 스크립트로 md4, md5, hex 변환하기 (0) | 2007.10.18 |
날아 다니는 이미지 (0) | 2007.10.18 |
레이어 셀렉트 박스 최상위에... (0) | 2007.10.18 |
콤보박스(셀렉트박스다운) 메뉴 미 선택시 컬러 바뀌게... (0) | 2007.10.18 |
지정 시간 후 재생 시작되는 스크립트 (0) | 2007.10.18 |
포커스 하일라이트 주기 (0) | 2007.10.18 |
페이지 확대 / 페이지 축소 (0) | 2007.10.18 |
한글만 되게 하기 (0) | 2007.10.18 |
방문자 OS보여주기 (0) | 2007.10.18 |
쿠키 적용으로 체크하면 다음부터는 뜨지 않는 창
인터넷정보2007. 10. 18. 13:44
새창뛰우는 창의헤드부분에 삽입.(본페이지)
<script language="javascript">
//쿠키값을 가져오는 함수
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))
}
}
//getCookie 함수를 호출하여 쿠키값을 가져온다.
var blnCookie = getCookie("member_gender");
//쿠키값이 true가 아닐 경우에만 새 창을 띄운다.
if ( !blnCookie ) {
window.open('cook.html','_blink','width=225,height=250,scrollbars=no,toolbar=no,left=0,top=0');
}
</script>
---------여기까지------
새창에 들어갈 소스(cook.html)
<html>
<head>
<script language="javascript">
//쿠키 생성 함수
function setCookie(name, value, expire) {
var expire_date = new Date(expire)
document.cookie = name + "=" + escape(value) + "; expires=" + expire_date.toGMTString();
}
//쿠키 소멸 함수
function clearCookie(name) {
var today = new Date()
//어제 날짜를 쿠키 소멸 날짜로 설정한다.
var expire_date = new Date(today.getTime() - 60*60*24*1000)
document.cookie = name + "= " + "; expires=" + expire_date.toGMTString()
}
//체크 상태에 따라 쿠키 생성과 소멸을 제어하는 함수
function controlCookie(elemnt) {
if (elemnt.checked) {
//체크 박스를 선택했을 경우 쿠키 생성 함수 호출
setCookie("member_gender","true","July 18, 2010 00:00:00")
//setTimeout("self.close()");
}
else {
//체크 박스를 해제했을 경우 쿠키 소멸 함수 호출
clearCookie("member_gender")
}
return
}
</script>
</head>
<body>
<p>
<form>
<A onclick="javascript:document.all.closeEvent.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="closeEvent" onClick="controlCookie(this)">다시는 이창 열지 않기
<input type="button" value="닫기" onclick='self.close();'><br>
</form>
</body>
</html>
-----여기까지
<script language="javascript">
//쿠키값을 가져오는 함수
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))
}
}
//getCookie 함수를 호출하여 쿠키값을 가져온다.
var blnCookie = getCookie("member_gender");
//쿠키값이 true가 아닐 경우에만 새 창을 띄운다.
if ( !blnCookie ) {
window.open('cook.html','_blink','width=225,height=250,scrollbars=no,toolbar=no,left=0,top=0');
}
</script>
---------여기까지------
새창에 들어갈 소스(cook.html)
<html>
<head>
<script language="javascript">
//쿠키 생성 함수
function setCookie(name, value, expire) {
var expire_date = new Date(expire)
document.cookie = name + "=" + escape(value) + "; expires=" + expire_date.toGMTString();
}
//쿠키 소멸 함수
function clearCookie(name) {
var today = new Date()
//어제 날짜를 쿠키 소멸 날짜로 설정한다.
var expire_date = new Date(today.getTime() - 60*60*24*1000)
document.cookie = name + "= " + "; expires=" + expire_date.toGMTString()
}
//체크 상태에 따라 쿠키 생성과 소멸을 제어하는 함수
function controlCookie(elemnt) {
if (elemnt.checked) {
//체크 박스를 선택했을 경우 쿠키 생성 함수 호출
setCookie("member_gender","true","July 18, 2010 00:00:00")
//setTimeout("self.close()");
}
else {
//체크 박스를 해제했을 경우 쿠키 소멸 함수 호출
clearCookie("member_gender")
}
return
}
</script>
</head>
<body>
<p>
<form>
<A onclick="javascript:document.all.closeEvent.checked=true;closeWin();window.opener.document.location.href='event.html';" href="#None">
<IMG src="event.gif" border=0>
</A>
<input type="checkbox" name="closeEvent" onClick="controlCookie(this)">다시는 이창 열지 않기
<input type="button" value="닫기" onclick='self.close();'><br>
</form>
</body>
</html>
-----여기까지
'인터넷정보' 카테고리의 다른 글
프레임 나누어진 페이지 늘리기 - 확장시키기 (0) | 2007.10.18 |
---|---|
프레임 나타내기(히든프레임)와 숨기기 (0) | 2007.10.18 |
셀렉트 박스 새창과 현재창을 라이오 버튼으로 제어 (0) | 2007.10.18 |
셀렉트를 이용해서 이미지 선택 나타내기 (0) | 2007.10.18 |
이미지 슬라이드 (0) | 2007.10.18 |
이미지에 섬광 효과 주기 (0) | 2007.10.18 |
자바스크립트와 테이터베이스 연동 (0) | 2007.10.18 |
TextField의 Align - 텍스트 정렬 및 콤마 찍기 (0) | 2007.10.18 |
텍스트 애니메이션 (0) | 2007.10.18 |
웹페이지 대화상자 (부모창 위에 새창이 항상 최상위에 존재) (0) | 2007.10.18 |
새창 가운데 열기 - 중앙에 열기
인터넷정보2007. 10. 18. 13:27
새창으로 열 문서에 삽입하시면 됨니다.
아래 스크립트를 head 태그 안에 삽입하세요.
<script LANGUAGE=JavaScript>
function ctcwin(){
window.moveTo((window.screen.width-document.body.clientWidth)/2,(window.screen.height-document.body.clientHeight)/2-45);
}
</script>
바디 태그에 onLoad='ctcwin();' 삽입하시구요.
ex - <body onLoad='ctcwin();' leftmargin='0' marginwidth='0' marginheight='0''>
또는 문서 끝 </body> 바로 윗줄에 onload대신 아래 스크립트를 삽입.
<script>
ctcwin()
</script>
아래 스크립트를 head 태그 안에 삽입하세요.
<script LANGUAGE=JavaScript>
function ctcwin(){
window.moveTo((window.screen.width-document.body.clientWidth)/2,(window.screen.height-document.body.clientHeight)/2-45);
}
</script>
바디 태그에 onLoad='ctcwin();' 삽입하시구요.
ex - <body onLoad='ctcwin();' leftmargin='0' marginwidth='0' marginheight='0''>
또는 문서 끝 </body> 바로 윗줄에 onload대신 아래 스크립트를 삽입.
<script>
ctcwin()
</script>
'인터넷정보' 카테고리의 다른 글
다중 셀렉트(select) 박스 2 (0) | 2007.10.18 |
---|---|
다중 셀렉트(select) 박스 (0) | 2007.10.18 |
스크립트 인코딩 (Windows Script Encoder) (0) | 2007.10.18 |
익스플로러에서 인쇄 누르면 페이지 이동 시키기 (0) | 2007.10.18 |
마우스 오버/아웃시 소리효과 초간단 자바스크립트 (0) | 2007.10.18 |
필드값의 유효성을 검사하는 함수 (0) | 2007.10.18 |
태그피아 웹에디터 (태그 연습장, 인코딩, 디코딩, 색상표, 특수문자 변환, 한줄소스) (0) | 2007.10.18 |
원 클릭으로 클립보드 복사하기 3 - input (0) | 2007.10.18 |
타이틀바에 년/월/일/시간/분/초 나타내기 (0) | 2007.10.18 |
산돌커뮤니케이션 폰트 무료 다운로드 행사 (0) | 2007.10.18 |
문서없이 새창 띄우기
인터넷정보2007. 10. 17. 18:08
<html>
<head>
<title> </title>
</head>
<body>
<script LANGUAGE=javascript>
function cmtnew() {
var newpage = window.open('','newpage','width=450,height=200,left=0,top=0,scrollbars=1,resizable=1');
var page = "";
page += ' <html> \n';
page += ' <head> \n';
page += ' <title>문서 없이 새창 띄우기 </title> \n';
page += ' <style type="text/css"> \n';
page += ' body { \n';
page += ' scrollbar-highlight-color: #000000; \n';
page += ' scrollbar-shadow-color: #000000; \n';
page += ' scrollbar-arrow-color: #000000; \n';
page += ' scrollbar-face-color: #FFFFFF; \n';
page += ' scrollbar-3dlight-color: #FFFFFF; \n';
page += ' scrollbar-darkshadow-color: #FFFFFF; \n';
page += ' scrollbar-track-color: #FFFFFF; \n';
page += ' } \n';
page += ' </style> \n';
page += ' </head> \n';
page += ' <body> \n';
page += ' <font style=font-size:9pt;>내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br><br> \n';
page += ' 추가시 이 라인을 복사해서 사용하세요. </font>\n';
page += ' <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> ......\n';
page += ' </body> \n';
page += ' </html> \n';
newpage.document.open();
newpage.document.write(page);
newpage.document.close();
}
</script>
<a href="#" OnClick = "cmtnew();">문서없이 창 띄우기</a>
</body>
</html>
자동으로 페이지 로딩시 창을 띄우고 싶다면 <body onload='cmtnew()'>를 사용하세요.
<head>
<title> </title>
</head>
<body>
<script LANGUAGE=javascript>
function cmtnew() {
var newpage = window.open('','newpage','width=450,height=200,left=0,top=0,scrollbars=1,resizable=1');
var page = "";
page += ' <html> \n';
page += ' <head> \n';
page += ' <title>문서 없이 새창 띄우기 </title> \n';
page += ' <style type="text/css"> \n';
page += ' body { \n';
page += ' scrollbar-highlight-color: #000000; \n';
page += ' scrollbar-shadow-color: #000000; \n';
page += ' scrollbar-arrow-color: #000000; \n';
page += ' scrollbar-face-color: #FFFFFF; \n';
page += ' scrollbar-3dlight-color: #FFFFFF; \n';
page += ' scrollbar-darkshadow-color: #FFFFFF; \n';
page += ' scrollbar-track-color: #FFFFFF; \n';
page += ' } \n';
page += ' </style> \n';
page += ' </head> \n';
page += ' <body> \n';
page += ' <font style=font-size:9pt;>내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br> \n';
page += ' 내용 <br><br> \n';
page += ' 추가시 이 라인을 복사해서 사용하세요. </font>\n';
page += ' <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> ......\n';
page += ' </body> \n';
page += ' </html> \n';
newpage.document.open();
newpage.document.write(page);
newpage.document.close();
}
</script>
<a href="#" OnClick = "cmtnew();">문서없이 창 띄우기</a>
</body>
</html>
자동으로 페이지 로딩시 창을 띄우고 싶다면 <body onload='cmtnew()'>를 사용하세요.
'인터넷정보' 카테고리의 다른 글
페이지 로드후 머문시간 분과 초만 나타내기 (0) | 2007.10.17 |
---|---|
시간대별 다른 이미지 나타나게.. (0) | 2007.10.17 |
시간대별 다른 메세지 출력하기 (0) | 2007.10.17 |
다음카페 배경음악 플레이어 삽입하기 (시노부 bgm등....) (0) | 2007.10.17 |
키코드 값 - key code (0) | 2007.10.17 |
롤오버(마우스 오버)시, 클릭시 순서대로 이미지 트렌제이션 효과 (0) | 2007.10.17 |
새창 띄울때 정 중앙에 열기 (0) | 2007.10.17 |
키보드 키코드 값 정리 (익스플로전용) (0) | 2007.10.17 |
언어에 따라 페이지 지정하는법. (0) | 2007.10.17 |
마우스 오버시 새창 띄우기 (0) | 2007.10.17 |
새창 띄울때 정 중앙에 열기
인터넷정보2007. 10. 17. 18:08
<HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
//-->
</script>
</HEAD>
<BODY>
<CENTER>
<a href="http://oxtag.com/zboard/warning_member.php" onclick="NewWindow(this.href,'name','600','400','yes');return false">새창 중앙에 열기</a>
</CENTER>
</BODY>
</HTML>
<HEAD>
<TITLE></TITLE>
<script language="javascript">
<!--
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}
//-->
</script>
</HEAD>
<BODY>
<CENTER>
<a href="http://oxtag.com/zboard/warning_member.php" onclick="NewWindow(this.href,'name','600','400','yes');return false">새창 중앙에 열기</a>
</CENTER>
</BODY>
</HTML>
'인터넷정보' 카테고리의 다른 글
시간대별 다른 메세지 출력하기 (0) | 2007.10.17 |
---|---|
다음카페 배경음악 플레이어 삽입하기 (시노부 bgm등....) (0) | 2007.10.17 |
키코드 값 - key code (0) | 2007.10.17 |
문서없이 새창 띄우기 (0) | 2007.10.17 |
롤오버(마우스 오버)시, 클릭시 순서대로 이미지 트렌제이션 효과 (0) | 2007.10.17 |
키보드 키코드 값 정리 (익스플로전용) (0) | 2007.10.17 |
언어에 따라 페이지 지정하는법. (0) | 2007.10.17 |
마우스 오버시 새창 띄우기 (0) | 2007.10.17 |
WEB IME - 한글을 영어로 표기하기 :: 영문을 한글로.. (0) | 2007.10.17 |
자바스크립트 :: 객체 prototype에서 setInterval 문제점 (0) | 2007.10.17 |
마우스 오버시 새창 띄우기
인터넷정보2007. 10. 17. 18:07
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body bgcolor="#FFFFFF">
<script language="JavaScript">
<!--
headstring = "<HTML><HEAD><TITLE>TEST . Click</TITLE><HEAD>"
bodystring = "<BODY bgcolor=#FFFFFF>"
endstring = "</BODY></HTML>"
iswin1 = 0;
function me() {
if (iswin1==1) return;
win1 = open ("","","width=400,height=50");
win1.document.open();
win1.document.write (headstring);
win1.document.write (bodystring);
text1 ="<b><font size=4>메롱~♡</b><p>";
text1 = "<center>" + text1 + "</font></center>";
win1.document.write (text1);
win1.document.write (endstring);
win1.document.close();
iswin1 = 1;
}
function me1() {
if (iswin1==0) return;
win1.close();
iswin1 = 0;
}
//-->
</script>
<a href="http://daum.net" onMouseOver="me()" onMouseOut="me1()" onClick="me1()">마우스를 올려보세용;;;<a>
<br> 클릭하면 연결페이지로 이동합니다.
</body>
</html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>
<body bgcolor="#FFFFFF">
<script language="JavaScript">
<!--
headstring = "<HTML><HEAD><TITLE>TEST . Click</TITLE><HEAD>"
bodystring = "<BODY bgcolor=#FFFFFF>"
endstring = "</BODY></HTML>"
iswin1 = 0;
function me() {
if (iswin1==1) return;
win1 = open ("","","width=400,height=50");
win1.document.open();
win1.document.write (headstring);
win1.document.write (bodystring);
text1 ="<b><font size=4>메롱~♡</b><p>";
text1 = "<center>" + text1 + "</font></center>";
win1.document.write (text1);
win1.document.write (endstring);
win1.document.close();
iswin1 = 1;
}
function me1() {
if (iswin1==0) return;
win1.close();
iswin1 = 0;
}
//-->
</script>
<a href="http://daum.net" onMouseOver="me()" onMouseOut="me1()" onClick="me1()">마우스를 올려보세용;;;<a>
<br> 클릭하면 연결페이지로 이동합니다.
</body>
</html>
'인터넷정보' 카테고리의 다른 글
문서없이 새창 띄우기 (0) | 2007.10.17 |
---|---|
롤오버(마우스 오버)시, 클릭시 순서대로 이미지 트렌제이션 효과 (0) | 2007.10.17 |
새창 띄울때 정 중앙에 열기 (0) | 2007.10.17 |
키보드 키코드 값 정리 (익스플로전용) (0) | 2007.10.17 |
언어에 따라 페이지 지정하는법. (0) | 2007.10.17 |
WEB IME - 한글을 영어로 표기하기 :: 영문을 한글로.. (0) | 2007.10.17 |
자바스크립트 :: 객체 prototype에서 setInterval 문제점 (0) | 2007.10.17 |
자바스크립트 배열 검사 (0) | 2007.10.17 |
다익스트라(Dijkstra) 알고리즘 (0) | 2007.10.17 |
TV, 영화에 사용된 폰트 (0) | 2007.10.17 |
항상 화면의 중간에 새창 띠우기
인터넷정보2007. 10. 17. 17:57
항상 화면 중앙에 새창 띠우기
미리보기 : http://oxtag.com/html/ex/new_win_center.html
미리보기 : http://oxtag.com/html/ex/new_win_center.html
아래 소스를 헤드안에 넣으세요. <SCRIPT LANGUAGE="JavaScript"> <!-- function launchCenter(url, name, height, width) { var str = "height=" + height + ",innerHeight=" + height; str += ",width=" + width + ",innerWidth=" + width; if (window.screen) { var ah = screen.availHeight - 30; var aw = screen.availWidth - 10; var xc = (aw - width) / 2; var yc = (ah - height) / 2; str += ",left=" + xc + ",screenX=" + xc; str += ",top=" + yc + ",screenY=" + yc; } return window.open(url, name, str); } var win = launchCenter('../filter.html', 'center', 220, 440); // --> </SCRIPT> |
'인터넷정보' 카테고리의 다른 글
공지창 쿠키 이용해 하루에 한번만.... (0) | 2007.10.17 |
---|---|
윈도우를 살포시 흔들어보자. (0) | 2007.10.17 |
텍스트 다이나믹 애니메이션 (0) | 2007.10.17 |
링크 포커스 한방에 없애기(onfocus=this.blur() 또는 onfocus=blur()) (0) | 2007.10.17 |
새창으로 윈도우 열었을때 F11 클릭시 자동 다운시키기 (0) | 2007.10.17 |
원 클릭으로 클립보드에 복사하기(우측 태그피아 배너) (0) | 2007.10.17 |
textarea 늘리기/줄이기 (0) | 2007.10.17 |
keystroke - 지정한 텍스트 타이핑시 연결된 URL로 이동 (0) | 2007.10.17 |
fade in/out (0) | 2007.10.17 |
페이지 로딩될때 준비한 메시지 로딩시까지 보여주기 - 로딩바 (0) | 2007.10.17 |
클릭 한번으로 창 여러개 띄우기 - 팝업, 새창 두개 이상
인터넷정보2007. 10. 12. 13:55
<script>
<!--
function gotourl(){
for(i=0;i<=gotourl.arguments.length-1;i+=2){
window.open(gotourl.arguments[i],gotourl.arguments[i+1]);
// 바로 윗 줄 대신 아래걸 사용하면 팝업창의 속성을 지정할 수 있습니다.
// window.open(gotourl.arguments[i],gotourl.arguments[i+1],"toolbar=no, width=350,height=200");
}
}
//-->
</script>
<a href="javascript:gotourl('http://oxtag.com','frame1','http://hanmail.net','frame2','http://google.com','frame3')">링크클릭</a>
<br /><br />
<iframe src="http://oxtag.com/html/img/newborn.jpg" width=800 height=600 frameborder="0" name="frame3" scrolling=auto style="border:solid 1px gray;"></iframe>
'인터넷정보' 카테고리의 다른 글
담배의 역사 (0) | 2007.10.12 |
---|---|
SimpleChat - 개인 홈페이지에서 사용가능한 1:1 상담 채팅 (0) | 2007.10.12 |
GChat (0) | 2007.10.12 |
오른쪽 마우스 해제 (0) | 2007.10.12 |
firefox 주소창, 검색창에서 한글주소 바로가기 구현 (0) | 2007.10.12 |
absolute positioning (0) | 2007.10.12 |
팝업 타이머 - 새창 타이머 (0) | 2007.10.12 |
텍스트 카운팅 (0) | 2007.10.12 |
텍스트 확대 축소 소스 (0) | 2007.10.12 |
퍼즐 게임 - puzzle (0) | 2007.10.12 |
<script>
function pop_open_nos(url,name,width,height){
var left = (screen.width-width)/2;
var top = (screen.height-height)/3;
var toolbar_str = 0;
var menubar_str = 0;
var statusbar_str = 0;
var scrollbar_str = 0;
var resizable_str = 0;
var property ='left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str
pop_result = window.open(url, name, property);
return pop_result;
}
</script>
<input name="" type="button" onClick="pop_open_nos('http://kr.yahoo.com','test',200,300);" value="실험">
function pop_open_nos(url,name,width,height){
var left = (screen.width-width)/2;
var top = (screen.height-height)/3;
var toolbar_str = 0;
var menubar_str = 0;
var statusbar_str = 0;
var scrollbar_str = 0;
var resizable_str = 0;
var property ='left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str
pop_result = window.open(url, name, property);
return pop_result;
}
</script>
<input name="" type="button" onClick="pop_open_nos('http://kr.yahoo.com','test',200,300);" value="실험">
'인터넷정보' 카테고리의 다른 글
[JS] 배열 소트 기능함수 사용, Array sorting (0) | 2007.10.11 |
---|---|
JS로 벡터이미지 그리기 (0) | 2007.10.11 |
예쁜 폰트들 (0) | 2007.10.11 |
IE,FF 의 투명도 설정 : opacity (0) | 2007.10.11 |
insert row 테이블에 row 추가하기 (0) | 2007.10.11 |
한국 전통 표준색 (0) | 2007.10.11 |
PHP용 경과시간 체크함수 /php timer 타이머/ microtime() (0) | 2007.10.11 |
showModalDialog Method (IE 전용) (0) | 2007.10.11 |
showModelessDialog 를 FF에서 사용하기 (0) | 2007.10.11 |
문자열 <-> 유니코드 변환 escape(),unescape() (0) | 2007.10.11 |
클릭 한번으로 창 여러개 두개 이상 띄우기
인터넷정보2007. 10. 10. 11:25
<script>
<!--
function gotourl(){
for(i=0;i<=gotourl.arguments.length-1;i+=2){
window.open(gotourl.arguments[i],gotourl.arguments[i+1]);
// 바로 윗 줄 대신 아래걸 사용하면 팝업창의 속성을 지정할 수 있습니다.
// window.open(gotourl.arguments[i],gotourl.arguments[i+1],"toolbar=no, width=350,height=200");
}
}
//-->
</script>
<a href="javascript:gotourl('http://oxtag.com','frame1','http://hanmail.net','frame2','http://google.com','frame3')">링크클릭</a>
<br><br>
<iframe src="http://oxtag.com/html/img/newborn.jpg" width=800 height=600 frameborder="0" name="frame3" scrolling=auto style="border:solid 1px gray;"></iframe>
<!--
function gotourl(){
for(i=0;i<=gotourl.arguments.length-1;i+=2){
window.open(gotourl.arguments[i],gotourl.arguments[i+1]);
// 바로 윗 줄 대신 아래걸 사용하면 팝업창의 속성을 지정할 수 있습니다.
// window.open(gotourl.arguments[i],gotourl.arguments[i+1],"toolbar=no, width=350,height=200");
}
}
//-->
</script>
<a href="javascript:gotourl('http://oxtag.com','frame1','http://hanmail.net','frame2','http://google.com','frame3')">링크클릭</a>
<br><br>
<iframe src="http://oxtag.com/html/img/newborn.jpg" width=800 height=600 frameborder="0" name="frame3" scrolling=auto style="border:solid 1px gray;"></iframe>
'인터넷정보' 카테고리의 다른 글
폰트 사이트 (0) | 2007.10.10 |
---|---|
레이어 여러개 반투명하게 교차하기 (0) | 2007.10.10 |
모서리 둥근 테이블, 이미지 없이 구현하기 (0) | 2007.10.10 |
로딩 페이지에 들어갈 이미지가 여기다 있습니다 (0) | 2007.10.10 |
라이트박스 효과 (이미지, 아이프렘, html 지원) (0) | 2007.10.10 |
스크립트로 이미지 모서리를 둥글게 (0) | 2007.10.10 |
XML 을 이용한 세로 플래시 메뉴 Ver 1.1 (0) | 2007.10.10 |
이쁜 테이블 태그입니다. (0) | 2007.10.10 |
무료 사용 가능한 오픈 디자인 사이트 14곳 모음 (0) | 2007.10.09 |
패비콘을 3d 도트로 변환해주는 사이트 (0) | 2007.10.09 |