Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap

Q1185 Why can't I access an image within a layer nested within a layer?

You are here: irt.org | FAQ | DHTML | Q1185 [ previous next ]

In theory it should be possible to access the image within a nested layer with:


However this doesn't seem to work once you specifiy a style position of absolute for the nested layer.

This would appear to be a bug.

If you don't specify absolute positioning then it works:

<body onLoad="loaded()">

<ilayer id="top">
    <layer id="nested">
    <img src="image.gif" name="myImage">

<script language="JavaScript"><!--
function loaded() {

Alternatively - you can add the layer in afterwards:

<body onLoad="addLayers()">

<ilayer id="top">

<script language="JavaScript"><!--
function addLayers() {

    myLayer = new Layer(100,document.layers['top']);

    document.layers['top'].document.layers[0].document.write('<img src="image.gif" name="myImage">');


©2018 Martin Webb