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.  
  3.  background-color: red;">
  4.  
  5.   <P><FONT SIZE=+2>Layer A</FONT></P>
  6.  
  7.  
  8.  
  9.   <BLOCKQUOTE ID=layerA1 STYLE="position: absolute; left: 20; top: 30;
  10.  
  11.    background-color: yellow">
  12.  
  13.     <P><FONT SIZE=+2>Layer A1</FONT></P>
  14.  
  15.  
  16.  
  17.     <P ID=layerA1a STYLE="position: relative; left: 20; top: -24;
  18.  
  19.      background-color: lightGreen">
  20.  
  21.     <FONT SIZE=+2>Layer A1a</FONT></P>
  22.  
  23.  
  24.  
  25.     <LAYER ID=layerA1b LEFT=20 TOP=60 STYLE="background-color: orange;">
  26.  
  27.       <P><FONT SIZE=+2>Layer A1b</FONT></P>
  28.  
  29.     </LAYER>
  30.  
  31.   </BLOCKQUOTE>
  32.  
  33. </DIV>
  34.  
  35.  
  36.  
  37. <BLOCKQUOTE>
  38.  
  39. <P><FONT SIZE=+1><U>Layer A1</U></FONT></P>
  40.  
  41. <P><B>Parent Layer:</B><BR>
  42.  
  43.  
  44.  
  45.   <SCRIPT>
  46.  
  47. document.writeln(document.layers[0].document.layers['layerA1'].
  48.  
  49. cc]parentLayer.name);
  50.  
  51.   </SCRIPT>
  52.  
  53. </P>
  54.  
  55.  
  56.  
  57. <P><B>Child Layers:</B><BR>
  58.  
  59.  
  60.  
  61.   <SCRIPT>
  62.  
  63.     function printChildLayers(rootDocument)
  64.  
  65.     {
  66.  
  67.       for (var i=0; i<rootDocument.layers.length; i++)
  68.  
  69.       {
  70.  
  71.         document.writeln(rootDocument.layers[i].name);
  72.  
  73.         document.writeln("<BR>");
  74.  
  75.       }
  76.  
  77.     }
  78.  
  79.  
  80.  
  81.     printChildLayers(document.layers[0].document.layers['layerA1'].document);
  82.  
  83.   </SCRIPT>
  84.  
  85. </P>
  86.  
  87. </BLOCKQUOTE>
  88.  
  89.