====================================================================
쿠키를 이용해서 광고창 제어하는 소스
====================================================================
<html>
<head>
<title>Untitled</title>
</head>
<body>
<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.test.chkbox.checked ){
setCookie( "notice0428", "done" ,30 );
}
self.close();
}
// -->
</SCRIPT>
<form name="test">
<p>여기에 원하시는 내용을 넣습니다.
<INPUT TYPE=CHECKBOX NAME="chkbox"><B>Do not open this window next time</B></font>
<input type=button value="close" onClick="closeWin();">
</form>
</body>
</html>
<!--start sima--><center><input type="button" value="View Source" onClick='window.location="view-source:"+window.location.href'><!--end sima-->
====================================================================
====================================================================
배경이 위쪽에만 나오게 하는 또다른 방법
====================================================================
<body bgcolor="" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="http://happyscript.com/testimage/bg3.jpg"; style="background-repeat:repeat-x" >
위쪽에만 반복적으로 나옵니다. ====================================================================
====================================================================
텍스트박스 안에 배경 이미지 넣기 textarea
====================================================================
<body>
일반 img tag을 이용해서 부른 경우입니다.<br>
<img src="http://happyscript.com/testimage/bg1.jpg"; xwidth=177 xheight=17 alt="" border="0">
<br>
텍스트박스(textare) 안에 스타일을 이용해서 배경이미지를 넣은 경우입니다.<br>
<textarea style="background-image:url(http://happyscript.com/testimage/bg1.jpg); width=313; height=416">
배경이미지와 텍스트가 같이 있습니다.
여기에서 텍스트를 입력할 수 있습니다.
====================================================================
배경색과 글자색을 바꿔주는 소스
====================================================================
<SCRIPT LANGUAGE="JavaScript">
<!--
function color() {
document.bgColor=(""+ colc.cc.value +""); // 배경색 부분
document.body.text=(""+ colc.tc.value +""); // 글자색 부분
}
//-->
</script>
<!--
폼 구성 부분
색 추가시는 간단히 option만 복사하여 늘려준 후 색을 적어주면 된다.
색은 아무거나 적어도 됨.. EX) black,#000000
//-->
<form name="colc">
<table border="1">
<tr>
<td colspan="2" align="center">
<b>Color Change</b>
</td>
</tr>
<tr>
<td align="center">
<b>배경색</b>
</td>
<td align="center">
<select name="cc" size="1">
<option value="black">Black
<option value="blue">Blue
<option value="green">Green
<option value="skyblue">Light Blue
<option value="orange">Orange
<option value="purple">Purple
<option value="red">Red
<option value="silver">Silver
<option value="Yellow">Yellow
<option selected value="white">White
</select>
</td>
</tr>
<tr>
<td align="center">
<b>글자색</b>
</td>
<td align="center">
<select name="tc" size="1">
<option selected value="black">Black
<option value="blue">Blue
<option value="green">Green
<option value="skyblue">Light Blue
<option value="orange">Orange
<option value="purple">Purple
<option value="red">Red
<option value="silver">Silver
<option value="Yellow">Yellow
<option value="white">White
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" name="button" value="바꾸기" onclick="color()" style="width:100%">
</td>
</tr>
</table>
</form><input type=button name=simabuttonviewsource value="View Source" onClick='window.location="view-source:"+window.location.href'>
====================================================================
====================================================================
하루중 시간대에 따라 배경이 다른 자스
====================================================================
<script language="JavaScript">
<!-- Hide From Old Browsers
day=new Date() //..get the date
x=day.getHours() //..get the hour
if(x>=0 && x<4) {
document.write('<body background="../../../testimage/bg1.jpg">')
} else
if(x>=4 && x<12) {
document.write('<body background="../../../testimage/bg2.jpg">')
} else
if(x>=12 && x<18) {
document.write('<body background="../../../testimage/bg3.jpg">')
} else
if (x>=18 && x<24) {
document.write('<body background="../../../testimage/bg4.jpg">')
}
<!-- End Hiding -->
</script>
====================================================================
====================================================================
배경화면이 움직이는 자스
====================================================================
<BODY>
<script language="Javascript">
<!--
var background = "../../../testimage/bg8.jpg";
var speed = 0;
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName != "Netscape" || browserVer >= 6) {
function moveback(movert,movedn,hPos,vPos) {
if (arguments[4])
document.body.style.backgroundImage = "url("" + arguments[4] + "")";
if (arguments[5])
document.body.style.backgroundRepeat = arguments[5]
if (!isNaN(hPos)) {
if ((movert!=0) && (hPos>0)) hPos=-100000
hPos += movert
}
if (!isNaN(vPos)) {
if ((movedn!=0) && (vPos>0)) vPos=-100000
vPos+= movedn
}
document.body.style.backgroundPosition= hPos + " " + vPos
if (isNaN(hPos)) hPos = """ + hPos + """
if (isNaN(vPos)) vPos = """ + vPos + """
setTimeout("moveback("+movert+","+movedn+","+hPos+","+vPos+")",speed)
}
moveback(1,1,0,0, background);
}
//-->
</script>
====================================================================
색이 줄단위로 바뀌는 테이블
====================================================================
<table border="0" width="500" height="200">
<tr onMouseOver="this.style.backgroundColor='#E8F6FF';return true;" onMouseOut="this.style.backgroundColor=''; return true;">
<td align=center><a href="'./sima_bbs.cgi?)">색이 줄단위로 바뀌는 테이블</a></font></td>
<td>--------------------------</td>
</tr>
</table>
====================================================================
====================================================================
페이지 들어갈때 배경색을 정하고 들어가는 소스
====================================================================
<body bgcolor="white" onload="var bg = prompt('색상코드를 입력해 주세요! 예: FF00FF',''); document.bgColor=bg;"><input type=button name=simabuttonviewsource value="View Source" onClick='window.location="view-source:"+window.location.href'>
====================================================================
====================================================================
색상-테이블의 색이 차츰차츰 변하게하는 자스 예제
====================================================================
<html>
<head>
<title>http://perlbbs.com<;/title>
<script language="javascript">
<!--
var tInC=null;
var tIdC=null;
var tIdCOn = new Array(0,0,0,0,0,0);
var tIdCOff = new Array(1,1,1,1,1,1);
function tBgFIn(obj, col,idNum) {
if(tInC != obj && tInC != null && tIdCOn[idNum] == 0) tBgFOut(tInC,tIdC);
if(tIdCOn[idNum] == 0) {
tIdCOn[idNum] = 1;
tIdCOff[idNum] = 0;
tInC=obj;
tIdC=idNum;
changeColor(obj, col);
}
}
function tBgFOut(obj,idNum) {
if(tIdCOff[idNum] == 0) {
tIdCOff[idNum] = 1;
tIdCOn[idNum] = 0;
changeColor(obj, "#ffffff");
}
}
function changeColor(obj, col) {
obj.filters.blendTrans.apply();
obj.style.backgroundColor= col;
obj.filters.blendTrans.play();
}
//-->
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<TABLE border=0 width=100%>
<TR>
<TD colSpan=2 align=center>
<TABLE border=2 borderColor=#ff9900 cellPadding=3 cellSpacing=3
style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; BORDER-RIGHT: 0px; BORDER-TOP: 0px">
<TR><!-- 1 -->
<TD align=middle id=bgColorId1
onmouseover="tBgFIn(bgColorId1, '#CCFFCC',1)"
style="BACKGROUND-COLOR: #ffffff; FILTER: blendTrans(duration=0.3)"
vAlign=top width=120>
<TABLE bgColor=#ffff99 border=0
style="BORDER-TOP: rgb(255,153,0) 2px solid" width="100%">
<TR>
<TD width=100>
<P align=center><A
href="http://perlbbs.com"; terget=new><FONT
color=blue><B>마우스를 여기로 옮겨보세요</B></FONT></A></P></TD></TR></TABLE>
<P>이 테이블의 색이 점차적으로 변합니다.<BR></P></TD>
<TD align=middle id=bgColorId2
onmouseover="tBgFIn(bgColorId2, '#CCFFFF',2)"
style="BACKGROUND-COLOR: #ffffff; FILTER: blendTrans(duration=0.5)"
vAlign=top width=120>
<TABLE bgColor=#ffff99 border=0
style="BORDER-TOP: rgb(255,153,0) 2px solid" width="100%">
<TR>
<TD width=100>
<P align=center><A
href="http://perlbbs.com"; terget=new><FONT
color=blue><B>마우스를 여기로 옮겨보세요</B></FONT></A></P></TD></TR></TABLE>
<P>이 테이블의 색이 점차적으로 변합니다.<BR></P></TD>
<TD align=middle id=bgColorId3
onmouseover="tBgFIn(bgColorId3, '#FFFFCC',3)"
style="BACKGROUND-COLOR: #ffffff; FILTER: blendTrans(duration=0.5)"
vAlign=top width=120>
<TABLE bgColor=#ffff99 border=0
style="BORDER-TOP: rgb(255,153,0) 2px solid" width="100%">
<TR>
<TD width=100>
<P align=center><A
href="http://perlbbs.com"; terget=new><FONT
color=blue><B>마우스를 여기로 옮겨보세요</B></FONT></A></P></TD></TR></TABLE>
<P>이 테이블의 색이 점차적으로 변합니다.<BR></P></TD>
</TR></TABLE>
</body>
</html>
<!--start sima--><center><input type="button" value="View Source" onClick='window.location="view-source:"+window.location.href'><!--end sima-->
====================================================================
====================================================================
multiple select에 추가하는 예제~~
====================================================================
<HTML>
<HEAD>
<TITLE>apoka.net</TITLE>
<Script language=javascript>
<!--
function addPrd()
{
var frm = document.frmName1;
var add_value = frm.prd_group1[frm.prd_group1.selectedIndex].value;
var add_text = frm.prd_group1[frm.prd_group1.selectedIndex].text;
frm.prd_insert.options[frm.prd_insert.options.length] = new Option(add_text,add_value);
}
//-->
</script>
</HEAD>
<BODY>
<form name="frmName1">
<select name="prd_group1" style="width:190px;">
<option value="" selected>==대분류==</option>
<option value="01">apoka1</option>
<option value="02">apoka2</option>
<option value="03">apoka3</option>
<option value="04">apoka4</option>
</select>
<input type="button" value="추가" name="insetOK" onClick="addPrd()">
<select name="prd_insert" multiple style="width:100px;">
</select>
</form>
</BODY>
</HTML>
====================================================================
====================================================================
서브메뉴~~~~
====================================================================
<html>
<head>
<SCRIPT language=javascript>
var old='';
function menu(name)
{
submenu=eval("submenu_"+name+".style");
if(old!=submenu)
{
if(old!='')
{
old.display='none';
}
submenu.display='block';
old=submenu;
}
else
{
submenu.display='none';
old='';
}
}
</SCRIPT>
</head>
<body>
<a onclick="menu(1);" style="CURSOR:hand"><b>메뉴1</b></a>
<br>
<span id=submenu_1 style="DISPLAY: none;">
서브메뉴<br>
서브메뉴<p>
</span>
<a onclick="menu(2);" style="CURSOR:hand"><b>메뉴2</b></a>
<span id=submenu_2 style="DISPLAY: none;">
서브메뉴<br>
서브메뉴<p>
</span></body>
</html>
====================================================================
====================================================================
마우스 갖다대면 서브메뉴가~~
====================================================================
<html>
<head>
<title></title>
</head>
<style type="text/css">
<!--
body {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:150%; color: #000000}
table {font-family: "고딕", "Helvetica", "sans-serif"; font-size: 10px; xline-height:100%; color: #000000}
A:link { text-decoration: none; color:#333333}
a:visited { color: #333333; text-decoration: none}
a:hover { color: blue; text-decoration: underline} -->
</style>
<script language="javascript">
<!--
var main_cnt = 6
function showhide(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
if (menu.display=="block") {
menu.display="none";
imgch.src="+.gif";
}else {
menu.display="block";
imgch.src="-.gif";
}
//}else {
// menu.display="none";
// imgch.src="+.gif";
}
}
}
function show(num) {
for (i=1; i<=main_cnt; i++) {
menu=eval("document.all.block"+i+".style");
imgch=eval("document.bar"+i);
if (num==i) {
menu.display="block";
imgch.src="-.gif";
}else {
menu.display="none";
imgch.src="+.gif";
}
}
}
//-->
</script>
</HEAD>
<BODY>
<SCRIPT language="JavaScript">
document.cookie.expires="0";
</SCRIPT>
<center>
<TABLE borderColor=white cellSpacing=0 cellPadding=0 width=135 border=1>
<TR>
<TD xonclick="showhide(1);" onmouseover="this.style.backgroundColor='#ffffcc'; show(1);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar1 src="+.gif" border=0 width=12 height=12>
A</TD>
</TR>
<TR>
<TD>
<SPAN id=block1 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ffffcc'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target=_top>
A-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ffffcc'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
A-2</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
A-3</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
A-4</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
<TR>
<TD xonclick="showhide(2);" onmouseover="this.style.backgroundColor='#ccddff'; show(2);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar2 src="+.gif" border=0 width=12 height=12>
<xa href="http://apoka.net"; target=_top>
B</a></TD>
</TR>
<TR>
<TD>
<SPAN id=block2 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
B-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
B-2</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
B-3</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<xA href="sub1-1">
B-4</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
<TR>
<TD xonclick="showhide(3);" onmouseover="this.style.backgroundColor='#ccddff'; show(3);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar3 src="+.gif" border=0 width=12 height=12>
<xa href="http://apoka.net"; target=_top>
C</a></TD>
</TR>
<TR>
<TD>
<SPAN id=block3 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
C-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
C-2 </a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
C-3</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
C-4</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
<TR>
<TD xonclick="showhide(4);" onmouseover="this.style.backgroundColor='#ccddff'; show(4);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar4 src="+.gif" border=0 width=12 height=12>
<xa href="http://apoka.net"; target=_top>
D</a></TD>
</TR>
<TR>
<TD>
<SPAN id=block4 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
D-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
D-2</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
D-3</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
D-4</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
<TR>
<TD xonclick="showhide(5);" onmouseover="this.style.backgroundColor='#ccddff'; show(5);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar5 src="+.gif" border=0 width=12 height=12>
<xa href="http://apoka.net"; target=_top>
E</a></TD>
</TR>
<TR>
<TD>
<SPAN id=block5 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<xA href="sub1-1">
E-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
E-2</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
E-3</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="right">
E-4</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<xa href="http://apoka.net"; target="right">
E-5</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
<TR>
<TD xonclick="showhide(6);" onmouseover="this.style.backgroundColor='#ccddff'; show(6);" style="CURSOR: hand" onmouseout="this.style.backgroundColor=''" borderColorLight=gray bgColor=#cccccc gray #e4e4e4 xheight=14>
<IMG name=bar6 src="+.gif" border=0 width=12 height=12>
<xa href="http://apoka.net"; target=_top>
F</a></TD>
</TR>
<TR>
<TD>
<SPAN id=block6 style="DISPLAY:none; MARGIN-LEFT:1px; xCURSOR:hand">
<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 border=1 WIDTH="100%">
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="new">
F-1</a>
</TD></TR>
<TR height=12px onmouseover="this.style.backgroundColor='#ccddff'" onmouseout="this.style.backgroundColor=''" bgColor=#e4e4e4 borderColorLight=gray>
<TD align=right valign=center>
<a href="http://apoka.net"; target="new">
F-2</a>
</TD></TR>
</TABLE>
</span>
</td>
</tr>
</table>
</body>
</html>
====================================================================