¸¶¿ì½º°¡ °³Ã¼ À§·Î ¿Ã°¡°¡ ÀÖ´Â µ¿¾È MouseOver() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ°í, ¹ÛÀ¸·Î ³ª°¡¸é MouseOut() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
<SCRIPT> function MouseOver(obj){ obj.style.backgroundColor='#ffff00'; } function MouseOut(obj){ obj.style.backgroundColor='#00ffff'; } </SCRIPT> <DIV onMouseOver="MouseOver(this)" onMouseOut="MouseOut(this)" style="width:400;border:solid 1 blue;padding:4px">¸¶¿ì½º¸¦ ¹Ú½º À§·Î, ¹ÛÀ¸·Î À̵¿ ½ÃÄÑ º¸¶ó</DIV>
¸¶¿ì½º¸¦ ´©¸£°í ÀÖ´Â µ¿¾È mouseDown() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ°í, ³õÀ¸¸é mouseUp() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
<SCRIPT> function mouseDown(obj){ obj.style.backgroundColor='#ffff00'; } function mouseUp(obj){ obj.style.backgroundColor='#00ffff'; } </SCRIPT> <DIV onMouseDown="mouseDown(this)" onMouseUp="mouseUp(this)" style="width:300;border:solid 1 blue;padding:4px">¿©±â¼ ¸¶¿ì½º¸¦ ´·¶´Ù ³õ¾Æ º¸¶ó</DIV>
¸¶¿ì½º°¡ ´¸®¸é MusDown() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ°í, ³õÀ¸¸é MusOut() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ°í, ¸¶¿ì½º¸¦ °³Ã¼ À§¿¡¼ À̵¿½ÃÅ°¸é(onmousemove) MusMove() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
µÎ ¿¹Á¦¿¡¼ °øÈ÷ ¸¶¿ì½º¸¦ À̵¿ÇÏÁö ¾Ê°í ´©¸£°í ³õ±â¸¸ ÇÏ¸é ³ì»ö¹è°æÀÌ ³ªÅ¸³ªÁö ¾Ê°í, À̵¿ÇÏ´Â °æ¿ì(onmousemove)¿¡¸¸ ³ì»ö¹è°æÀÌ ³ªÅ¸³´Ù.
<SCRIPT> function MusDown(obj){ obj.style.backgroundColor='#ffff00'; } function MusUp(obj){ obj.style.backgroundColor='#00ffff'; } function MusMove(obj){ obj.style.backgroundColor='#00ff00'; } </SCRIPT> <DIV onMouseDown="MusDown(this)" onMouseUp="MusUp(this)" onMouseMove="MusMove(this)" style="width:400;border:solid 1 blue;padding:4px">¸¶¿ì½º¸¦ ´·¶´Ù ³õ¾Æ º¸°í ¸¶¿ì½º¸¦ À̵¿½ÃÄÑ º¸¶ó</DIV>
¸¶¿ì½º°¡ °³Ã¼ À§¸¦ ´©¸£°í ÀÖ´Â µ¿¾È µ¿¾È marqueeCall() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÏ°í, ´©¸¥ °ÍÀ» ³õÀ¸¸é marqueeStop() ±â´ÉÇÔ¼ö¸¦ È£ÃâÇÑ´Ù.
<DIV id="imagearea"> </DIV> <FORM name="formn"> <INPUT type="button" name="buttonn" value="¸¶¿ì½º¸¦ ´ë°í ´·¯ º¸¶ó" onMouseDown="marqueeCall()" onMouseUp="marqueeStop()"> </FORM> <SCRIPT> function marqueeCall(){ imagearea.innerHTML='<MARQUEE><IMG src="../../../gif/rfexample.gif"></MARQUEE>';} function marqueeStop(){ imagearea.innerHTML='';} </SCRIPT>
°á°ú | °á°ú Ç¥½Ãâ |
<SCRIPT> var ss=''; function whatHappen(eventObj){ ss+=eventObj+', '; showArea.innerHTML=ss; } </SCRIPT> <DIV class=show style="color:blue;cursor:hand;border:solid 1 blue" onclick="whatHappen(event.type)" onmousedown="whatHappen(event.type)" onmouseup="whatHappen(event.type)" ondblclick="whatHappen(event.type)">¿©±â¸¦ Ŭ¸¯ÇØ º¸¶ó</DIV> <TABLE width=100%><TR> <TD width=5%>°á°ú</TD> <TD id="showArea" style="border:solid 1 teal;background:ffe;color:blue">°á°ú Ç¥½Ãâ</TD> <TD width=1%><INPUT type="button" value="´Ù½Ã" onClick="ss='';showArea.innerHTML='°á°ú Ç¥½Ãâ'"></TD> </TR></TABLE>