¦^«e­¶

Netscape ¤¤ HTML ¼ÐÅÒÀÀ LAYER ¤Æ

Netscape ªº³Ì­«­nªº§ï¼g¤¸¥ó LAYER
¬Û¸û©ó Internet Explorer 4.0 ª©«áªº HTML ¼ÐÅÒ¥þ­±ª«¥ó¤Æ¡A¤ä´©°ÊºA CSS ª«¥ó¡A¥H¤Î°ÊºA§ï¼g¤¸¥ó innerHTML,outerHTML ÄÝ©Ê¡A´X¥G©Ò¦³ªº HTML ¼ÐÅÒ¡A³£¥i¥H ·í°µ§ï¼g¤¸¥ó¡CNetscape ¦b°ÊºA§ï¼g¤¸¥ó¤Wªº¤ä´©¤W¡A«oÅ㪺¤Q¤ÀÁ¡®z¡A¶Ç²Î HTML ¼ÐÅÒ°£¤F FORM ªþÄÝ¿é¤J¤¸¥óªº value ¡A¤Î IMG ¼ÐÅÒªº SRC ÄÝ©Ê¥~¡A¯u¥¿¯àºÙ§@¤@­Ó ¥\¯à§¹¾ãªº°ÊºA§ï¼g¤¸¥ó¡A¥u¦³ 4.0 ª©¥H«á±À¥Xªº LAYER ¤¸¥ó²Õ¡A©Ò¥H­n°õ¦æ Netscape ªº°ÊºA§ï¼g¡A´N¤£¯à¿òº|¹ï LAYER ¤¸¥ó²Õªº±´°Q¡C
LAYER ¬O¤@²Õ¥\¯à
©Î³\§A¹ï§@ªÌ¤£ºÙ LAYER ¼ÐÅÒ¡A¦ÓºÙ LAYER ¤¸¥ó²Õ¦³¨ÇÃhºÃ¡A§A©Î³\¤]·|¸ÑÄÀ »¡¦]¬° Netscape ¤¤ÁÙ¦³­Ó ILAYER ¼ÐÅÒ¡A¤]¨ã¦³³¡¥÷§ï¼g¯à¤O¡A©Ò¥H©M LAYER ¦XºÙ LAYER ¤¸¥ó²Õ¡C·íµM¡A³o»ò»¡¤£¯àºÙ¬°¿ù¡A¦ý«o¹ï Netscape ½á¤© LAYER ªº¥\¯à»{ÃÑ ¤£°÷¥þ­±¡CNetscape ¤£¥u§â°ÊºA§ï¼gªº¯à¤O»±­­©ó LAYER ©M ILAYER ¨â­Ó¼ÐÅÒ¤W¡A ¨ä¹ê¥¦¬O§â©Ò¦³»Ý­n¤ä´©°ÊºA§ï¼gªº HTML ¼ÐÅÒ¡AÂà¤Æ¨ì¤@­Ó layers ¶°¦X¤¤¡A­É¥Ñ ¦¹ºØ¤@¯ë¼ÐÅÒªº LAYER ¤Æ¡A½á¤©¸Ó¼ÐÅҰʺA§ï¼g¯à¤O¡C
HTML ¼ÐÅÒ¦p¦ó LAYER ¤Æ
¦b Netscape ¤¤¡A°£¤F LAYER ©M ILAYER ¨ã¦³ LAYER ¤¸¥ó§ï¼g¯à¤O¥~¡A¤@¯ë¶Ç²Î HTML ¤¤ªº Block-Level ¼ÐÅÒ¡A¤]¥i¸g¥Ñ³]©w CSS position ÄÝ©Ê¡A¨Ï¨ä¨ú±o·Ç LAYER ©ÎºÙ§@ÀÀ LAYER ªº¯à¤O¡A¶i¦Ó¦¨¬° Netscape document.layers ¶°¦Xª«¥ó¤¤ ªº¦¨­û¡C¦p<DIV STYLE="position:absolute;"> ±N¨Ï±o³o­Ó DIV °Ï¬q³Q·í°µ·Ç LAYER ¨Ó³B²z¡A¦Ó <SPAN STYLE="position:relative;"> «h·|¨Ï SAPN ¼ÐÅÒ³Q ·í°µ·ÇILAYER ¨Ó§PÂ_¡C§Ú­Ì¥i¥H°µ­Ó¹êÅç¡A§Ú­Ì¥ý¦b HTML ¤¤³o»ò¼g¡G
<DIV ID="div1">
    §Ú¬O HTML DIV °Ï¬q
</DIV>
µM«á¥Î³o¼Ëªº JavaScript ¹ï document.layers ª«¥ó¤º®e¥[¥H°»´ú¡G
    var obj,str="";
    for (obj in document.layers)
    {str+=obj+" : "+document.layers[obj]+"\n";}
°õ¦æµ²ªG½Ð«ö ³oùØ¡C ·í§A«ö¤U [layers ª«¥ó°»´ú] ¶s®É¡A¸ê°TÅã¥Ü¬° "length:0" ¡Aªí¥Ü layers ¤¤¨S¦³ ¥ô¦ó layer ª«¥ó¡C±µµÛ§Ú­Ì¬° DIV ¼ÐÅÒ¥[¤J CSS position ÄÝ©Ê¡G
<DIV ID="div1" STYLE="position:absolute;">
    §Ú¬O position=absolute ªº DIV °Ï¬q
</DIV>
¨Ã¥B¼W¥[¤F H2,P,SPAN ¤T­Ó¼ÐÅÒ¡A¦³ªº position ¬° relative ¡A¦³ªººû«ù static ªº ¹w³]ª¬ºA¡A°õ¦æµ²ªG½Ð«ö ³oùØ¡C ¥Ñ½d¨Ò¥iª¾¡A¤Z¬O position ¬° relative or absolute ªº¡A³£¥[¤J¤F document.layers ¶°¦Xª«¥ó¤¤¡Aposition ¬° static ©Î¨S¦³³]ªº¡A«h¤´ºû«ù­ì»ª¡C
Layer ©M ÀÀ Layer ª«¥óªº¨Ï¥Î°Ï§O
°ò¥»¤W·í HTML Block-Level ¼ÐÅÒ³z¹L CSS ªº position Äݩʦb Netscape ¤¤¨ú±o ·Ç Layer ¤¸¥ó¦a¦ì®É¡A¥¦¦P®É¤]¨ã¦³¤F Layer ¤¸¥óªº°ÊºA§ïÅܯà¤O¡A¦ý¨ä¤¤¦³¨Ç °ÊºA§ïÅܤΨƥ󰻴ú¯à¤O«h¬O¼Ð·Ç Layer ¤¸¥ó±M¦³ªº¡A·Ç Layer ¤¸¥ó¨Ã¤£¨ã¦³¦¹ºØ ¯à¤O¡C¥H¤U¬O§Ú­Ì´N Netscape 4.5 ¤¤¤åª©´ú¸Õªºµ²ªG¡G
  1. ­p¶q³æ¦ìªº°Ï§O¡G
      CSS ¬°¤F§ó¦nªº¤ä´©ºô­¶¤¸¥óªº½s±Æ©w¦ì¡A¥¦ªº¤j¤pªø¼eªº«×¶q³æ¦ì¥i¥H ¦³¬Û¹ï³æ¦ì(em)¡Bµ´¹ï³æ¦ì(pt,mm,px)©M¦Ê¤À¤ñ(120%)¤TºØ¤è¦¡¡A³o¹ï ¨ó§U³]­pºô¸ô¤W¤£¦P¿Ã¹õ¤Î¦r«¬µwÅé²ÕºA¾A¥Îªººô­¶¦³«Ü¤jªºÀ°§U¡C¦ý LAYER ©M ILAYER ¼ÐÅÒ¥u¤ä´© px ¤@ºØµ´¹ï«×¶q³æ¦ì¤Î¦Ê¤À¤ñ«×¶q³æ¦ì¡A ³o¦b ILAYER µ¥ relative ªº¤¸¥ó¤W§xÂZÁÙ¤p¡A¦ý¹ï LAYER µ¥ absolute ¤¸¥ó«o·|³y¦¨¤£¦P¨Ï¥ÎÀô¹ÒÆ[µøµ²ªG·|®t²§«Ü¤jªº§x¹Ò¡C
  2. ´¡¤J¥~³¡Àɮתº°Ï§O¡G
      ¼Ð·Ç LAYER ©M ILAYER ¼ÐÅһݭn´¡¤J¥~³¡ªº HTML Àɮ׬O¾a SRC ÄÝ©Ê¨Ó «ü©w¡A¦ýÀÀ layer ©M ilayer ¤¸¥ó«h¥²¶·¨Ï¥Î CSS ªº include-source Äݩʨӳ]©w¡A¦p STYLE="include-source:url('¥~³¡ÀÉ®× URL');"¡C·íµM include-source ¤£¬O W3C ¨î©wªº¼Ð·Ç CSS ³W®æ¡A¦Ó¬O Netscape 4 ¦Û¤v ªº³W®æ¡C
  3. °ÊºA§ïÅÜ´¡¤JÀɮתº°Ï§O¡G
      ³o©Î³\¤£¬O layer ©M ·Ç layer ¤¸¥óªº®t§O¡A¦Ó¬O Netscape ¤º³¡ layer ¤¸¥ó©M ilayer ¤¸¥óªº®t§O¡A¨º´N¬O layer ¤¸¥ó¥i¥H¦b Script ±Ô­z¤¤ÂÇ document.layerName.src="·s´¡¤JÀÉ®× URL"; ¨Ó§ïÅÜ´¡¤JÀÉ®× ¡A¦ý ilayer ¤¸¥ó°õ¦æ¦P¼Ëªº»yªk¡Aµ²ªG«o¬OªÅ¥Õ¤@¤ù¡C¦Ó·Ç layer ¤¸¥ó «hÄ~©Ó¤F³oºØ­­¨î¡A positionz:absolute ªº¡AÄ~©Ó layer ¯à¤O¡A¥i¥H ¥¿±`§ïÅÜ¡A positionz:relative ªº¡A«hÄ~©Ó¤F ilayer ¡A¦ÓµLªk¥¿±` Åã¥Ü¡C
  4. °ÊºA§ï¼gÀɮת«¥óªº°Ï§O¡G
      layer ª«¥ó¦U­Ó°ÊºAÄݩʤ¤¡A¦³­ÓªþÄݤlª«¥ó¥s document¡A³o­Ó document ´N¦p window ¤Uªº document ¤lª«¥ó¤@¼Ë¡A¨ã³Æ¤F°µ¬°¨ä¥L ºô­¶¼ÐÅÒ®e¾¹¤Î°ÊºA¯à¤O¡C¨ä¤¤¦³­ÓÃö¯A°ÊºA§ï¼g«D±`­«­nªº¥\¯à´N¬O document.write() ¤èªk¡A¨ä´ú¸Õµ²ªG¥ç¦p«e¤@­Ó»¡©ú¡Alayer ©M·Ç layer ¤¸¥óªº document.write() ¥¿±`¡A¦ý ilayer ©M·Ç ilayer ¤¸¥ó µLªk¥¿±`Åã¥Ü¡C
  5. ¨Æ¥ó°»´ú¯à¤Oªº°Ï§O¡G
      layer ¤¸¥ó¨Ì Netscape ºô¯¸»¡ªk¡A¥i¥H¹ï¤U¦C¤­ºØ¨Æ¥ó¦³¤ÏÀ³¡A¤£¹L ¤]¯S§O«ü©ú¡A³o¨Ç¨Æ¥ó°»´ú¥u¤ä´© layer ¤¸¥ó¡A¨ä¥L ilayer ¤Î·Ç layer ©M·Ç ilayer ¤¸¥ó³£¤£¤ä´©¡A¦]¦¹¯S§O¦b¦¹¦C¥X¡A´£¿ô§Aª`·N¡C
    1. OnMouseOver
    2. OnMouseOut
    3. OnFocus
    4. OnBlur
    5. OnLoad

¦^«e­¶
1