Images contained in layers

They have: 5,633 posts

Joined: Jan 1970

I am trying to place an image inside a layer but not as a background. I want to animate the image by moving it left and making it smaller at the same time. Can this be done using a layer. I was hoping that by reducing the size of the layer the image would also be reduced. Is this possible.

They have: 231 posts

Joined: Feb 2000

Start off by putting an image within a layer. This will not set it as a background.

code:

<div id="layer1"
style="position:absolute;left:200;top:50;"><img
src=""
name="image1"
width="" height=""></div>[/code]

You can't make an image smaller by decreasing the layer size. You will have to change the images width & height properties.

code:
if (document.all)
document["image1"].width = ?

if (document.layers)
document.layers["layer1"].document["image1"].width = ?[/code]

If you need some more DHTML help just post here. 

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.