div dimensions within IE

  • Thread starter Miquel Escarrà
  • Start date
M

Miquel Escarrà

I want to adjust an image to a div section in my page.

In body section I wrote:
<body onload="adjustImage()"
<div id="myimage">
<img src="animage" id "image1">
</div>


adjustImage function reads "myimage" and adjusts image1 inside.

Within Internet Explorer browser, I can't get the div dimensions, I get the
"image1" dimensions instead:

divImage = document.getElementById("myimage")
nWidth = divImage.clientWidth

it returns image1.clientWidth. When I draw the div section without image1,
correct dimensions are returned.

Does someone knows a solution for this?

Miquel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top