ÀÌÁ¨ ½Ã°£¿¡ µû¶ó ·¹À̾ ÄÁÆ®·Ñ Çغ¸ÀÚ. Áï ¿øÇÏ´Â ½Ã°£ÈÄ¿¡ ¾î¶² À̺¥Æ®¸¦ ó¸®Çϵµ·Ï
ÇÏ´Â ¹æ¹ýÀ» ¾Ë¾Æº¸µµ·Ï ÇÏÀÚ. ÀÌ ¹æ¹ýÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ¸îÃÊÈÄ¿¡ ´Ù¸¥ À̺¥Æ® ¹ß»ý ½ÃÅ°±â¸¦ ÀÀ¿ëÇÑ ¹æ¹ýÀÌ´Ù.
HTML
Example |
<html>
<head>
<title>Hellow Homepage - DHTML</title>
<script language="JavaScript1.2"
src="cbdhtml.js">
</script>
</head>
<body bgcolor=black>
<!-- ÇÔ¼ö¸¦
ÁöÁ¤Çϴ°÷ -->
<script language="JavaScript1.2">
function hideall(){
hideLayer(text1);
hideLayer(text2);
hideLayer(text3);
return true;
}
function show_text1(){
hideall();
showLayer(text1);
setTimeout('show_text2()',1000*2);
return true;
}
function show_text2(){
hideall();
showLayer(text2);
setTimeout('show_text3()',1000*2);
return true;
}
function show_text3(){
hideall();
showLayer(text3);
setTimeout('show_text1()',1000*2);
return true;
}
</script>
<!-- ·¹À̾
»ý¼ºÇÏ´Â °÷ -->
<script language="JavaScript1.2">
var text1="text1";
content='<font size=2 color=white>2ÃÊÈÄ¿¡
±ÛÀÚ°¡ º¯ÇÕ´Ï´Ù.ÀÌ°Ç Ã¹¹ø° ¸ä¼¼Áö ÀÔ´Ï´Ù.</font>';
createLayer(text1,40,40,400,20,0,content);
var text2="text2";
content='<font size=2 color=blue>2ÃÊÈÄ¿¡
±ÛÀÚ°¡ º¯ÇÕ´Ï´Ù.ÀÌ°Ç µÎ¹ø° ¸ä¼¼Áö ÀÔ´Ï´Ù.</font>';
createLayer(text2,40,40,400,20,0,content);
var text3="text3";
content='<font size=2 color=#feb50c>2ÃÊÈÄ¿¡
±ÛÀÚ°¡ º¯ÇÕ´Ï´Ù.ÀÌ°Ç ¼¼¹ø° ¸ä¼¼Áö ÀÔ´Ï´Ù.</font>';
createLayer(text3,40,40,400,20,0,content);
<!-- ÃÖÃÊ
½ÇÇàµÇ´Â ÇÔ¼ö -->
show_text1();
</script>
</body>
</html> |
|
|
|
¼³¸í |
¿ì¼± ¾ÆÀ̵ð¾î¸¦ »ìÆ캸¸é
1.±ÛÀÚ¸¦ ½Ã°£º°·Î ´Ù¸£°Ô º¸¿©ÁÖ°íÀÚÇÑ´Ù.
2.º¸¿©ÁÙ ¸ä¼¼Áö¸¦ ·¹À̾î·Î »ý¼ºÇÑ´Ù.
3.°¢°¢ÀÇ ¸ä¼¼Áö´Â ¾Èº¸À̵µ·Ï ¼³Á¤ÇÑ´Ù.
4.Á¦ÀÏ Ã³À½ ù¹ø° ¸ä¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
5.ù¹ø° ¸ä¼¼Áö°¡ Ãâ·ÂµÇ°í 2ÃÊÈÄ¿¡ ÀÚ±âÀÚ½ÅÀº °¨Ãß·Î 2¹ø° ¸ä¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
6.µÎ¹ø° ¸ä¼¼Áö°¡ Ãâ·ÂµÇ°í 2ÃÊÈÄ¿¡ ÀÚ±âÀÚ½ÅÀº °¨Ãß°í 3¹ø° ¸ä¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
7.¼¼¹ø° ¸ä¼¼Áö°¡ Ãâ·ÂµÇ°í 2ÃÊÈÄ¿¡ ´Ù½Ã ù¹ø° ¸ä¼¼Áö¸¦ Ãâ·ÂÇÑ´Ù.
ÀÌ·± °úÁ¤À» Çϱâ À§Çؼ´Â ÀÏÁ¤½Ã°£ÀÌ Áö³ÈÄ ´Ù¸¥ ÇÔ¼ö¸¦ È£ÃâÇÏ´Â ¹æ¹ýÀ» ¾Ë¾ç
ÇÑ´Ù. ±×°ÍÀº ´ÙÀ½°ú °°´Ù.
setTimeout('¿øÇÏ´ÂÇÔ¼ö',1000*¿øÇÏ´ÂÃÊ);
¿©±â¼´Â óÀ½¿¡ show_text1()ÇÔ¼ö¸¦ ·¹ÀÌ¾î »ý¼ººÎºÐÀÇ Á¦ÀÏ ¸¶Áö¸·¿¡
Àû¾ú´Ù. µû¶ó¼ Á¦ÀÏ ¸ÕÀú ½ÇÇàµÇ´Â ÇÔ¼ö´Â show_text1()ÇÔ¼öÀÌ´Ù.
show_text1()ÇÔ¼ö¸¦ º¸¸é hideall()ÇÔ¼ö°¡ È£ÃâµÇ°í ±×´ÙÀ½¿¡
text1 ·¹À̾ º¸¿©ÁØ´Ù. hideall()ÇÔ¼ö´Â ¸ðµç ·¹À̾ ¾Èº¸À̵µ·Ï
ÇØÁÖµµ·Ï ¼³Á¤µÇ¾î ÀÖÀ½À» ½±°Ô ¾Ë ¼ö ÀÖ´Ù. show_text1()ÇÔ¼ö¿¡¼
·¹À̾ º¸¿©ÁÖ°í setTimeout()¸¦ ÀÌ¿ëÇÏ¿© 2ÃÊÈÄ¿¡ show_text2()ÇÔ¼ö¸¦
È£ÃâÇÏ´Â °ÍÀ» ¾Ë ¼ö ÀÖ´Ù.
¸¶Âù°¡Áö·Î show_text2()ÇÔ¼ö´Â ¸ðµç ·¹À̾ ¾Èº¸À̵µ·Ï ÇØÁÖ´Â hideall()À»
¸ÕÀú ½ÇÇàÇÏ°í ±×´ÙÀ½¿¡ text2·¹À̾ º¸À̵µ·Ï ÇØÁÖ´Â showLayer(text2)¸¦
È£ÃâÇÑ´Ù. ±×´ÙÀ½¿¡ ¿ª½Ã ¸¶Âù°¡Áö·Î 3¹ø° ¸ä¼¼Áö¸¦ º¸¿©Áö°Ô ÇÏ´Â show_text3()ÇÔ¼ö¸¦
2ÃÊÈÄ¿¡ setTimeout('show_text3()',1000*2); ¸¦
ÀÌ¿ëÇÏ¿© È£ÃâÇÑ´Ù.
¸¶Áö¸·À¸·Î show_text3()ÇÔ¼ö´Â À§¿¡¼¿Í ¸¶Âù°¡Áö·Î ½ÇÇàµÇ¸ç ¸¶Áö¸·¿¡
show_tex1()ÇÔ¼ö¸¦ È£ÃâÇϸç ÀÌ°ÍÀº ¹«ÇÑ ·çÇÁ·Î °è¼Ó ¹Ýº¹Çؼ ·¹À̾î
1, ·¹À̾î 2, ·¹À̾î 3À» ½Ã°£º°·Î È£Ãâ ÇÔÀ» ¾Ë ¼ö ÀÖ´Ù.
°¢°¢ÀÇ show_text1,2,3()ÇÔ¼ö´Â Á¦ÀÏ ¸ÕÀú hideall() ÇÔ¼ö¸¦
½ÇÇàÇؼ ¸ðµç ·¹À̾ °¨Ãá »óÅ¿¡¼ ÀÚ½ÅÀÇ ·¹À̾ º¸¿©Áشٴ ±â¹ýµµ ±â¾ï
Çϱ⠹ٶõ´Ù.
Á¦ÀÏ Ã³À½ºÎÅÍ ¿©±â±îÁö ÀÌÇØ°¡ µÇ¾ú´Ù¸é ÀÌÁ¨ ´ç½ÅÀº ·¹À̾ƿôÀÇ ÃµÀç°¡ µÉ°ÍÀÌ´Ù.
|
|
|
|
|