Click to See Complete Forum and Search --> : resize a layer in real-time


chronicle
06-24-2002, 08:27 AM
Hi

I want to resize a <div> layer like if I click on a link or an image the <div> layer will resize, from like width="200" to width="300". Do you know any way of doing this?

thanks
CS

Tekime
06-24-2002, 09:59 AM
That'll require the use of JavaScript; namely, the OnClick handler, to change the width style of the object.

You'll need to specify an object ID for your DIV:


<div id="myDiv">....</div>


And you can access the style of that DIV through JavaScript handlers like onClick, onMouseOver, etc.

In this case, the property to change would be 'myDiv.style.width'. Search on www.google.com if you can't put it together. If you really have a hard time drop another msg back here.

Happy coding :)