ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[±Ð¾Ç] (±Ð¾Ç²Ä25½g)¼v¹³ª«¥ó ¤W½g

[±Ð¾Ç] (±Ð¾Ç²Ä25½g)¼v¹³ª«¥ó ¤W½g

ºô­¶¤¤ªº¼v¹³(¹Ï¤ù)¦bJavaScript¬O±N¨äµø¬°¤@­Óºô­¶¤¸¥ó¡I¼v¹³¬O¤@­Óºô­¶¤¤ªº¤¸¥ó¡H³o»ò»¡¨Ó¡AJavaScript¤£´N¥i¥HÀH·Nªº¾Þ±±¥¦¡H¨S¿ù¡I¥u­n§A¦b¹Ï¤ù³sµ²¼ÐÅÒ<IMG>¤¤©w¸q¸Ó³sµ²¹Ï¤ùªº¦WºÙ¡]NAMEÄÝ©Ê¡^¡A¨º»ò­nÅÜ´«¹Ï¤ù³sµ²¼ÐÅҸ̪º¹Ï¤ù¡B©ÎªÌ¬O¥O¹Ï¤ù²£¥ÍÅÜ´«ªº®ÄªG¡A³q³q³£¬O»´©öªº¨Æ¡Aµuµuªº´X¦æµ{¦¡±Ô­z¡A´N¥i¥H³y´N¥XÅå¤Hªº®ÄªG¡I

°ò¦ªº¼v¹³±±¨î
½Ð§A¥ýÁ@¤@Á@¤U¦C³o¦æHTML¼ÐÅÒ¡G
  1. <IMG SRC=¡¨bg.gif¡¨ HEIGHT=¡¨100¡¨ WIDTH=¡¨50¡¨ NAME=¡¨mypic¡¨>
½Æ»s¥N½X
³o¬O¤@­Ó°ò¦ªºHTML¼v¹³³sµ²¼ÐÅÒ¹À¡I§A¥uµª¹ï¤F¤@¥b¡ASRC¡BHEIGHT¡BWIDTH³£¬O<IMG>¼ÐÅÒªº°ò¥»ÄÝ©Ê¡A¦ý¬O¡uNAME¡v©O¡H¥¦¬O<IMG>¼ÐÅÒªºÄݩʶܡH°ò¥»ªºHTML¸Ì<IMG>¼ÐÅҸ̨S¦³³o­ÓÄݩʧa¡I¨º¬°¤°»ò¦b<IMG>¼ÐÅҸ̥[¤W¤F¡uNAME¡v³o­Ó©_©ÇªºÄÝ©Ê©O¡H³o¬O¬°¤FÅý¥¦¦¨¬°ºô­¶¤¤ªº¤¸¥ó¡A¥H«K§Ú­ÌªºJavaScript¯à°÷¨Ó¾Þ±±¥¦¡A·í³o­Ó¼v¹³¦³¤F¦W¦r¡A§Ú­ÌªºJavaScript¤~¯à©I¨ä¡u¦W¡v¨Ó°Ñ·Ó¨Ï¥Î¡A¦p¤U¦¡¡G
  1. document.mypic    //mypic¬O¬Y¤@­Ó¼v¹³ªº¦WºÙ
½Æ»s¥N½X
¬JµM¦b<IMG>¼ÐÅҸ̬°¼v¹³¨ú¤F¦W¦r¡A¦ÓÅý³o¼v¹³¦¨¤Fºô­¶¤¤JavaScript¥i±±¨îªº¤¸¥ó¡]¦p¤W¦¡¤¤ªºmypic¡^¡A¬JµM¬OJavaScript¥i±±¨î¤¸¥ó¡A·íµM´N¦³¤F¤¸¥óªºÄÝ©Ê¡A¦Ó¼v¹³¤¸¥ó³Ì°ò¦ªºÄÝ©Ê´N¬O¡ySRC¡]¼v¹³Àɮס^¡z¡A³z¹L¹L³o­ÓÄݩʧڭ̴N¥i¥H§ïÅÜ<IMG>¼ÐÅҸ̩ҳsµ²ªºÀɮפº®e¡C


¹ê§@¾Ç²ß¡G
  1. <HTML>
  2. <HEAD>
  3. <TITLE>¼v¹³¤Á´«</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <SCRIPT Language="JavaScript">
  7. //·í·Æ¹««ü¼Ð²¾¦Ü¹Ï¤ù¤W
  8. function inpic()
  9. {
  10. document.mypic.src="bee.gif"
  11. }
  12. //·í·Æ¹«²¾¥X¹Ï¤ù
  13. function outpic()
  14. {
  15. document.mypic.src="ari.gif"
  16. }
  17. </SCRIPT>

  18. <IMG SRC="ari.gif" NAME="mypic" onMouseOver="inpic()" onMouseOut="outpic()">
  19. </BODY>
  20. </HTML>
½Æ»s¥N½X

  • ³o¬O¤@­Ó«Ü°ò¦ªº¼v¹³ÅÜ´«¨Ò¤l¡A¦b­ì©l½X²Ä19¦æ¸Ì¡A«Ø¥ß¤F¤@­Ó¹Ï¤ùªº³sµ²¡A¨Ã¥B±N¦¹¹Ï¤ù©R¦W¬°¡umypic¡v¡A¥H«KÅý¥¦¦¨¬°§Ú­ÌJavaScript¥i¥H¾Þ±±ªººô­¶¤¸¥ó¡C¦b³o­Ó<IMG>¼ÐÅÒ¤ºÁÙ¦w±Æ¤F¨â­Ó¨Æ¥ó³B²z¾¹¡uOnMouseOver¡v»P¡uonMouseOut¡v¡C
  • ¦bºô­¶¸ü¤J«á¡Aºô­¶¤¤±N¥X²{¤@­Ó<IMG>¼ÐÅÒ¹w¥ý³sµ²ªº¹Ï¤ù¡uari.gif¡v¡A·í§Ú­Ì±N·Æ¹««ü¼Ð²¾¦Ü¸Ó¹Ï¤ù¤W´N·|IJµo¡uOnMouseOver¡v¨Æ¥ó¥h©I¥sinpic()¨ç¦¡¡]µ{¦¡½X²Ä8¦æ¡^¡A¦¹®É¨ç¦¡¤ºªº±Ô­z¡udocument.mypic.src="bee.gif"¡v´N±N§Ú­Ìºô­¶¤¤¡umypic¡v¹Ï¤ù¤¸¥óªº³sµ²ÀÉ®×Åܧ󬰡ubee.gif¡v¡A©Ò¥H§A²{¦b©Ò¬Ý¨ìªº¹Ï¤ù±N¤£¦A¬O¡uari.gif¡v¡A¦Ó¬O¡ubee.gif¡v¡I
  • µM¦Ó¡A¦b·Æ¹««ü¼Ð²¾¥X¸Ó¹Ï¤ù®É¡A±NIJµo¡uOnMouseOut¡v¨Æ¥ó¥h©I¥soutpic()¨ç¦¡¡]µ{¦¡½X²Ä13¦æ¡^¡A¦¹®É¨ç¦¡¤ºªº±Ô­z¡udocument.mypic.src="ari.gif"¡v¤S±N§Ú­Ìºô­¶¤¤¡umypic¡v¹Ï¤ù¤¸¥óªº³sµ²ÀÉ®×Åܦ^¡uari.gif¡v¡A¦b·Æ¹««ü¼Ð²¾¶i»P²¾¥X¹Ï¤ù®É¡A´N²£¥Í¤F©Ò¿×ªº¡y¼v¹³¤Á´«®ÄªG¡z¡C




¶i¶¥À³¥Î¡G¹Ï¤ù¦¡¤p®ÉÄÁ
  1. <HTML>
  2. <HEAD>
  3. <TITLE>¹Ï¤ù¦¡¤p®ÉÄÁ</TITLE>
  4. </HEAD>
  5. <SCRIPT Language="JavaScript">
  6. function myclock()
  7. {
  8. //«Ø¥ß¤é´Á®É¶¡ª«¥ó
  9. inTime=new Date
  10. //¤p®É
  11. Hour="0"+inTime.getHours()
  12. Hour=Hour.substring(Hour.length-2,Hour.length)
  13. Hour1=Hour.charAt(1)
  14. Hour0=Hour.charAt(0)
  15. //¤ÀÄÁ
  16. Minute="0"+inTime.getMinutes()
  17. Minute=Minute.substring(Minute.length-2,Minute.length)
  18. Minute1=Minute.charAt(1)
  19. Minute0=Minute.charAt(0)
  20. //’
  21. Second="0"+inTime.getSeconds()
  22. Second=Second.substring(Second.length-2,Second.length)
  23. Second1=Second.charAt(1)
  24. Second0=Second.charAt(0)
  25. //§ó·sºô­¶¤¤ªº®É¶¡¹Ï¤ù
  26. document.hh1.src=Hour0+".gif"
  27. document.hh2.src=Hour1+".gif"
  28. document.mm1.src=Minute0+".gif"
  29. document.mm2.src=Minute1+".gif"
  30. document.ss1.src=Second0+".gif"
  31. document.ss2.src=Second1+".gif"
  32. //«Ø¥ß°ÊºA®É¶¡¾÷¨î
  33. setTimeout("myclock()",1000)
  34. }
  35. </SCRIPT>
  36. <!¡Xºô­¶¸ü¤J®É©I¥s¤p®ÉÄÁ¨ç¦¡ -->
  37. <BODY onLoad="myclock()">
  38. <IMG SRC="0.gif" NAME="hh1">
  39. <IMG SRC="0.gif" NAME="hh2">
  40. <IMG SRC="x.gif">
  41. <IMG SRC="0.gif" NAME="mm1">
  42. <IMG SRC="0.gif" NAME="mm2">
  43. <IMG SRC="x.gif">
  44. <IMG SRC="0.gif" NAME="ss1">
  45. <IMG SRC="0.gif" NAME="ss2">
  46. </BODY>
  47. </HTML>
½Æ»s¥N½X

  • ¦b³o­Ó½d¨Ò¤¤§Ú­Ì¹w³Æ¤F11±i¹Ï¤ù¡Aªü©Ô§B¼Æ¦r0¦Ü9»P¤À¹j²Å¸¹¹Ï¤ù¡u¡G¡v¡A½Ðª`·N¡A°£¤F¤À¹j²Å¸¹¹Ï¤ù¡u¡G¡v¬°x.gif¥~¡Aªü©Ô§B¼Æ¦r0¦Ü9¹Ï¤ù³£¬O¨Ì·Ó¼Æ¦r¨Ì§Ç©R¦W¡A°ÆÀɦW¥ç¥þ³¡¬Û¦P¡A¦p¤U¹Ï©Ò¥Ü¡G
    10-2.png
  • ¦bºô­¶¤¤§Ú­Ì¹w©w¤F6­Ó¹Ï¤ù¤¸¥ó¡A¤À§O¥Nªí10¦ì¼Æªº¤p®É¡]Name=¡¨hh1¡¨¡^¡B­Ó¦ì¼Æªº¤p®É¡]Name=¡¨hh2¡¨¡^¡B10¦ì¼Æªº¤ÀÄÁ¡]Name=¡¨mm1¡¨¡^¡B­Ó¦ì¼Æªº¤ÀÄÁ¡]Name=¡¨mm2¡¨¡^¡B10¦ì¼Æªº¬í¡]Name=¡¨ss1¡¨¡^¡B­Ó¦ì¼Æªº¬í¡]Name=¡¨ss2¡¨¡^¡A¦Ó®É¶¡ªº¤À¹j²Å¸¹¡]¡G¡^¹Ï¤ù¡A«h¥¼¥[¥H³]©w¡]­ì©l½X38¦Ü45¦æ¡^¡G
    10-4.png
  • ¦b<BODY>¼ÐÅÒ¤º¡A©ñ¸m¤F¤@­ÓOnLoad¨Æ¥ó³B²z¾¹¡A·íºô­¶¸ü¤J®É§YIJµoOnLoad¨Æ¥ó©I¥smyclock()¤p®ÉÄÁ¨ç¦¡¡A¶}©l²Ä¤@¦¸°ÊºAªº§ïÅܺô­¶¹Ï¤ù¤º®e¡]­ì©l½X37¦æ¡^¡C
  • µ{¦¡½X²Ä9¦æ¡A§Q¥Înew«Øºc¤l«Ø¥ß®É¶¡¤é´Áª«¥ónow()¡C
  • µ{¦¡½X²Ä11¡B16¡B21¦æ¡A§Q¥Î®É¶¡¤é´Áª«¥óªº¤èªkÂ^¨ú®É¶¡¡u¤p®É¡v¡B®É¶¡¡u¤ÀÄÁ¡v¡B®É¶¡¡u¬í¡v¡A¦P®É¡A¬°¤FÅã¥Ü"¨â¦ì¼Æ"ªº®É¶¡®æ¦¡¡A©Ò¥H¡A­Y¨ú±oªº®É¶¡¼Æ­È¤@«ß¦b¨ä«e¤è¥[¤W"0"¡C
  • µ{¦¡½X²Ä12¡B17¡B22¦æ¡A§Q¥Î.substring()¤èªkÂ^¨ú®É¶¡Åܼƪº¦r¤¸ªø«×¼Æ­È´î2»P®É¶¡Åܼƪº¦r¤¸ªø«×¼Æ­È¶¡ªº¤å¦r¡A¨Ò¦p¡G§Q¥ÎgetHours()¤èªk¨ú¦^ªº¼Æ­È¬°¡u12¡v¡A¦Ó§Ú­Ì¤S¦b¨ä«e¤è¸É­Ó¡u0¡v¡Aµ²ªG´N¦¨¬°¡u012¡v¡A¦¹®É¡A¦r¦êªø«×¬°3¡A«hsubstring()¤èªkÂ^¨ú¦r¦êªø«×´î2¡]3-2=1¡^»P¦r¦êªø«×¡]3¡^¶¡ªº¦r¦ê¸ê®Æ¡A«h¨äµ²ªG´N¬O¡y12¡z¡C
  • charAt()¤èªk¬°¨ú¦^¦r¦ê¤¤«ü©w¦ì¸mªº¦r¤¸¡Aµ{¦¡½X²Ä13¡B14¡B18¡B19¡B23¡B24¦æ¡C
  • µ{¦¡½X²Ä26¦Ü31¦æ¡A§ó·sºô­¶¤¤¼v¹³¤¸ªº¹Ï¤ùÀɮסC
  • µ{¦¡½X²Ä33¦æ¡A§Q¥ÎsetTimeout()¤èªk­«½Æ°õ¦æª¬ºA¦C¤p®ÉÄÁ¨ç¦¡¡C

¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¼v¹³ª«¥ó
¦b¤W¤@¸`¤¤¡A§Ú­Ìª½±µ¨Ï¥Î§ïÅܤ¸¥ó¹Ï¤ùÀɮתº¡uSRC¡vÄÝ©Ê¡A¦bºô­¶¤¤ª½±µªº§ïÅܹϤùÀɮסA¨C¦¸¶i¦æ¹Ï¤ùÀÉ®×Åܧó®É³£·|¦V¦øªA¾¹¯Á°Q¤@¦¸¹Ï¤ùÀɮסA¶i¦æÀɮפU¸üªº°Ê§@¡A¦pªG¦b¹Ï¤ùÀÉ®×Åé¿n¤£¤j¥Bºô¸ô³sµ²ª¬ªp¨}¦n¡A¦øªA¾¹¤£¦£¸Lªº±¡ªp¤U¡A¹Ï¤ùªº¤Á´«°Ê§@ÁÙºâ¥O¤Hº¡·N¡A¤£¹L¡A­Y¬O¹Ï¤ùÀÉ®×Åé¿nÃe¤j©Îºô¸ô¾Ã¶ëªº±¡ªp®É¡A­n¬Ý¨ì¹Ï¤ù¤Á´«ªº®ÄªG¡A¨º´N¦³ªºµ¥¤F¡C©Ò¥H§Ú­Ì´N¥²¶·¨Ï¥Î¹w¥ý¸ü¤Jªº¤è¦¡¡A±N­n²£¥Í¥æ´ÀÅÜ´«®ÄªGªº¨â­Ó¹Ï¤ùÀɮצP®É¤U¸ü¦ÜÂsÄý¾¹¤¤¡AÅý§Ú­Ì­n§ïÅÜÅã¥Üªº¹Ï¤ùÀɮׯà¥ß¨èªº¦bºô­¶¤¤Åã¥Ü¥X¨Ó¡C

­n¦P®É±N³Æ¥Îªº¨â­Ó¹Ï¤ùÀɮפU¸ü¦ÜÂsÄý¾¹¤¤(«È¤áºÝ)¡A§Ú­Ì¥²¶··Ç³Æ¡u®e¾¹¡v§â¥¦¸Ë°_¨Ó£«¡A¦Ó³o­Ó¡u®e¾¹¡v´N¬OJavaScriptªº¡yImage()¡z¼v¹³ª«¥ó¡G
  1. picbox = new Image()
  2. picbox.src = ¡§ari.gif¡¨
½Æ»s¥N½X
­º¥ý¡A§Q¥Înew«Øºc¤l«Ø¥ß¤@­Ó¦s©ñ¼v¹³ªºImage()¼v¹³ª«¥ópicbox¡A¦P®É¡A¨Ï¥Îpicbox¼v¹³ª«¥óªºSRCÄݩʱN¹Ï¤ùÀÉ®×ari.gif¦s©ñ¶i¥h¡]¨Æ¹ê¤W¬OÀx¦s¨ì§Ö¨ú°O¾ÐÅ餤¡A³o­Ó¹Ï¤ùÀɮר䣷|¥X²{¦bºô­¶¤¤¡^¡A¦p¦¹¤@¨Ó¡A·í§Ú­Ì­n¨Ï¥Îari.gif³o­Ó¹Ï¤ùÀɮ׮ɡA´N¤£¥²¦A°µ¤U¸üªº°Ê§@¡Aª½±µ±qpicbox¼v¹³ª«¥ó¸Ì®³¥X¨Ó¥Î´N¦æ¤F¡G
  1. document.mypic.src=picbox.src
½Æ»s¥N½X
¦p¤W¨Ò©Ò¥Ü¡G·í§Ú­Ì­n´À´«ºô­¶¤¤mypicªº¹Ï¤ùÀɮ׮ɡAª½±µ±Npicbox¤ºªº¹Ï¤ùÀɮרú¥X¨Ï¥Î§Y¥i¡C

¹ê§@¾Ç²ß¡G
§ï¼g½d¨Ò¡A±N¨â­Ó°µ¤Á´«ªº¹Ï¤ùÀɮױĹw¦sªº¤è¦¡¤U¸ü¦ÜÂsÄý¾¹¤¤¡A§@¹Ï¤ù¤Á´«ªº°Ê§@®É¤£¦A¦V¦øªA¾¹­n¨D¤U¸üÀɮסC
  1. <HTML>
  2. <HEAD>
  3. <TITLE>¼v¹³¤Á´«</TITLE>
  4. </HEAD>
  5. <BODY>
  6. <SCRIPT Language="JavaScript">
  7. //«Ø¥ß¦s©ñ¹Ï¤ùÀɮתº¼v¹³ª«¥ó
  8. picbox1 = new Image()
  9. picbox2 = new Image()
  10. //±N¹Ï¤ùÀÉ®×Àx¦s¦Üª«¥ó¤º
  11. picbox1.src="bee.gif"
  12. picbox2.src="ari.gif"

  13. //·í·Æ¹««ü¼Ð²¾¦Ü¹Ï¤ù¤W
  14. function inpic()
  15. {
  16. document.mypic.src=picbox1.src
  17. }
  18. //·í·Æ¹«²¾¥X¹Ï¤ù
  19. function outpic()
  20. {
  21. document.mypic.src=picbox2.src
  22. }
  23. </SCRIPT>

  24. <IMG SRC="ari.gif" NAME="mypic" onMouseOver="inpic()" onMouseOut="outpic()">
  25. </BODY>
  26. </HTML>
½Æ»s¥N½X
¦b³o­Ó½d¨Ò¤¤¡A§Ú­Ì§Q¥Înew«Øºc¤l¤À§O«Ø¥ß¨â­Ó¼v¹³ª«¥ó¡Gpicbox1»Ppicbox2¡AµM«á±N¹Ï¤ùÀɮפÀ§O¹w¦s¨ì³o¨â­Ó¼v¹³ª«¥ó¸Ì¡A·í§Ú­Ì»Ý­n§ïÅܺô­¶¤¤ªº¹Ï¤ù®É¡A´Nª½±µªº¦Ûpicbox1»Ppicbox2¼v¹³ª«¥ó¸Ì¨ú¥Î¹Ï¤ùÀɮסC
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¤H¨ÆªºÁ}Ãø»PµZ¿i¡A´N¬O¤@ºØ¦ÒÅç¡C
ªð¦^¦Cªí ¤W¤@¥DÃD