home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap15 / dun15_6.txt < prev    next >
Encoding:
Text File  |  1997-12-18  |  1.2 KB  |  45 lines

  1. <DIV ID=layerA STYLE="position: absolute; left: 300; top: 50;
  2.  background-color: red;">
  3.   <P><FONT SIZE=+2>Layer A</FONT></P>
  4.  
  5.   <BLOCKQUOTE ID=layerA1 STYLE="position: absolute; left: 20; top: 30;
  6.    background-color: yellow">
  7.     <P><FONT SIZE=+2>Layer A1</FONT></P>
  8.  
  9.     <P ID=layerA1a STYLE="position: relative; left: 20; top: -24;
  10.      background-color: lightGreen">
  11.     <FONT SIZE=+2>Layer A1a</FONT></P>
  12.  
  13.     <LAYER ID=layerA1b LEFT=20 TOP=60 STYLE="background-color: orange;">
  14.       <P><FONT SIZE=+2>Layer A1b</FONT></P>
  15.     </LAYER>
  16.   </BLOCKQUOTE>
  17. </DIV>
  18.  
  19. <BLOCKQUOTE>
  20. <P><FONT SIZE=+1><U>Layer A1</U></FONT></P>
  21. <P><B>Parent Layer:</B><BR>
  22.  
  23.   <SCRIPT>
  24. document.writeln(document.layers[0].document.layers['layerA1'].
  25. cc]parentLayer.name);
  26.   </SCRIPT>
  27. </P>
  28.  
  29. <P><B>Child Layers:</B><BR>
  30.  
  31.   <SCRIPT>
  32.     function printChildLayers(rootDocument)
  33.     {
  34.       for (var i=0; i<rootDocument.layers.length; i++)
  35.       {
  36.         document.writeln(rootDocument.layers[i].name);
  37.         document.writeln("<BR>");
  38.       }
  39.     }
  40.  
  41.     printChildLayers(document.layers[0].document.layers['layerA1'].document);
  42.   </SCRIPT>
  43. </P>
  44. </BLOCKQUOTE>
  45.