±×¸²ÀÚ¸¦ ¿òÁ÷¿© º¸ÀÚ. ÀÌ°Í ¶ÇÇÑ °£´ÜÇÏ´Ù. µÎ°³ÀÇ ¶È°°Àº ·¹À̾ ¸¸µé°í Çϳª´Â
°íÁ¤, Çϳª´Â °íÁ¤µÈ ·¹À̾îÀÇ ¹Ù·Î ¹ØÀ¸·Î À̵¿½ÃÅ°¸é ±×¸²ÀÚ¸¸µé±â¿¡¼ ¹è¿î½ÄÀ¸·Î ±×¸²ÀÚ°¡ ¿òÁ÷ÀÌ´Â µíÇÑ Âø°¢À»
ÁØ´Ù.
HTML
Example |
<html>
<head>
<title>Hellow Homepage</title>
<!--
cdhtml.js ÁöÁ¤ -->
<script language="JavaScript1.2"
src="cbdhtml.js">
</script>
<!--
HTMLÀÇ CSS ÂüÁ¶ -->
<style type="text/css">
H1 {
font-size:
23pt;
font-family:
Arial;
font-weight:
800;
color:
black;
}
H2 {
font-size:
23pt;
font-family:
Arial;
font-weight:
800;
color:
gray;
}
</style>
</head>
<body bgcolor=white>
<script language="JavaScript1.2">
<!--
ù¹ø°·¹À̾î»ý¼º ±×¸²ÀÚ·Î ¾µ°ÍÀÓ µû¶ó¼ ¸ÕÀú »ý¼ºÇؾ߰ÚÁÒ? -->
var text1="text1";
content='<H2>Dynamic HTML</H2>';
<!--
À§Ä¡ÁöÁ¤À» »ìÆ캸¼¼¿ä -->
createLayer(text1,240,240,300,100,1,content);
<!--
¾îµð·Î ½º¶óÀ̵ù Çұ °áÁ¤ÇÕ´Ï´Ù. -->
slideLayer(text1,42,42,200);
<!--
±×¸²ÀÚ°¡ ºñÄ¡°ÔÇÏ´Â ±ÛÀÚÁöÁ¤ -->
var text2="text2";
content='<H1>Dynamic HTML</H1>';
<!--
À§Ä¡»ìÆ캸¼¼¿ä -->
createLayer(text2,40,40,300,100,1,content);
</script>
</body>
</HTML> |
|
|
|
¼³¸í |
¿ì¼± ¾ÆÀ̵ð¾î´Â ±×¸²ÀÚ ¸¸µé±â¿¡¼ ½ÃÀÛ. ±ÛÀÚ·¹À̾
var text2=test2; ¿¡¼ ¸¸µé¾ú±¸,
±× ´ÙÀ½ À§Ä¡¸¦ ³»°¡ ¿øÇÏ´Â ´ë·Î ÁöÁ¤ÇÕ´Ï´Ù. ¿©±â¼´Â x=40, y=40
¿¡ ±ÛÀÚ·¹À̾ ÁöÁ¤ÇßÁÒ, ±×´ÙÀ½
¹æ±Ý ¸¸µç ±ÛÀÚ¿¡ ±×¸²ÀÚ¸¦ ¸¸µé¾î¾ß°ÚÁÒ. ±ÛÀÚ Å©±â´Â °°±¸ »ö±ò¸¸ ¹Ù²ß´Ï´Ù.
±×¸®°í ±×¸²ÀÚ¸¦ ¿òÁ÷¿©¼ ±ÛÀÚ ¹Ù·Î ¹Ø¿¡ °¡µµ·Ï ÇØ¾ß Çϴϱñ ±ÛÀÚÀÇ 45µµ
¿À¸¥ÂÊ ¾Æ·¡¿¡¼ ±ÛÀÚ·Î ¿òÁ÷ÀÌ´Â °Ô ÁÁ¾Æ º¸ÀÌ°ÚÁÒ. ±×·¡¼ Àû¿ë°á°úó·³ ÇÏ·Á¸é
±×¸²ÀÚ·¹À̾î´Â ±ÛÀÚ·¹À̾îÀÇ x,y ÁÂÇ¥¿¡¼ °¢°¢ 100¾¿ ´õÇϱâ(+) ÇÕ´Ï´Ù.
±×·¯´Ï±ñ ±×¸²ÀÚ ·¹À̾îÀÇ À§Ä¡´Â x=140(40+100) , y=140(40+100)
À¸·Î ÁöÁ¤ÇÕ´Ï´Ù.
±×´ÙÀ½¿¡ ±×¸²ÀÚ¸¦ ±ÛÀÚÀÇ ¹Ù·Î¹ØÀ¸·Î ½½¶óÀ̵ù ½Ãŵ´Ï´Ù. ½½¶óÀ̵ù ÇÔ¼ö¸¦ »ç¿ëÇϸé
µÇÁÒ...½½¶óÀ̵ù ÇÔ¼öÀÇ »ç¿ëÀº ÇöÀç ·¹À̾îÀÇ À§Ä¡¿¡¼ ¸¶Áö¸· °¡¼ ¸ØÃâ °÷ÀÇ
Á·Ḧ ÁöÁ¤ÇÏ¸é µË´Ï´Ù. ¹°·Ð ½ºÇǵ嵵 ÁöÁ¤ÇÏÁÒ.
ÃÖÁ¾ÀûÀ¸·Î ±×¸²ÀÚ°¡ ±ÛÀÚ ¹Ù·Î ¹Ø¿¡ °¡°Ô ÇÏ·Á¸é ±ÛÀÚ·¹À̾îÀÇ À§Ä¡ (40,40)º¸´Ù
¿À¸¥ÂÊ ¾Æ·¡¿¡ À§Ä¡Çϱâ À§ÇØ (42,42)·Î Àâ½À´Ï´Ù. ±×·³ ÀÌÁ¦ °¢°¢ÀÇ ·¹À̾
»ý¼ºµÇ°í ±×¸²ÀÚ ·¹À̾î´Â »ý¼ºµÈ ÁÂÇ¥ (140,140)¿¡¼ ÃÖÁ¾ ¸ñÇ¥ (42,42)±îÁö
½½¶óÀ̵ù ÇÏÁÒ.
Á¤¸» ½±´Ù...¹«½¼ Àå³°°½À´Ï´Ù. ±×ÁÒ?
|
|
|
|
|