Only Netscape uses layers. Internet Explorer will just ignore the LAYER tag. JavaScript functions to move elements need to use 'document.layers...' code but there's no real need for the actual LAYER tag itself, you can use the DIV tag and position this using style sheet positioning. However, here are the tag attributes defined.
Attributes | Examples |
ABOVE= | ABOVE="top-layer" |
BACKGROUND= | BACKGROUND="Mybackground.gif" |
BELOW= | BELOW="bottom-layer" |
BGCOLOR= |
BGCOLOR="#FFOOOO" BGCOLOR="red" |
CLIP= | CLIP=I0,I0,I00,I00 |
HEIGHT= |
HEIGHT=90 HEIGHT="25%" |
LEFT= |
LEFT=10 LEFT="20%" |
NAME= | NAME="mylayer" |
PAGEX= | PAGEX=10 |
PAGEY= | PAGEY=10 |
SRC= | SRC="my-page.html" |
TOP= |
TOP=10 TOP="15%" |
VISIBILITY= |
VISIBILITY=HIDE VISIBILITY=SHOW |
WIDTH= |
WIDTH=90 WIDTH="50%" |
Z-INDEX= |
Z-INDEX=2 Z-INDEX=1 |
Property | Write? | Associated Attribute (if any) |
clip.bottom | yes | CLIP= |
clip.height | yes | HEIGHT= |
clip.left | yes | CLIP= |
clip.right | yes | CLIP= |
clip.top | yes | CLIP= |
clip.width | yes | WIDTH= |
document | no | |
layers | no | |
left | yes | LEFT= |
name | no | NAME= |
parentLayer | no | |
siblingAbove | no | ABOVE= |
siblingBelow | no | BELOW= |
top | yes | TOP= |
visibility | yes | VISIBILITY= |
Methods | |
---|---|
moveBy( x-pixels, y-pixels ) | document.layers.myLayer.moveBy(O,-20) |
moveTo( x-pixels, y-pixels ) | document.layers.myLayer.moveTo(25,50) |
resizeBy( width, height) | document.layers.myLayer.resizeBy(-10,-10) |
resizeTo( width, height) | document.layers.myLayer.resizeTo(50,25) |
moveAbove( layername ) | document.layers.myLayer.moveAbove("layer_1") |
moveBelow( layername ) | document.layers.myLayer.moveBelow("layer_2") |
Events | |
---|---|
onMouseOver | When mouse moves over layer |
onMouseOut | When mouse moves off layer |
onfocus | When layer gets focus (is clicked, for example) |
onblur | When layer loses focus |
onload | When layer completes loading or is drawn |
Relatively positioned layers - all the above is the same for ILAYER, except for events. ILAYER does not have events.