Change height of DIV when div border set

M

marco_giuliani_it

I am changing the height of a div element and it works fine in ie, ff,
ns but when I add the div border style to "border:1px inset Black" it
doesn't change the height. border:solid works but I want more control.

Ay answers?

Cheers
Marco

function animateHeightDown(id, size)
{
el = document.getElementById(id);
var h_size1 = el.offsetHeight;
var w_size1 = el.offsetWidth;
alert("h = " + h_size1 + " w = "+w_size1);
if (w_size1 > 115)
{
el.style.width = w_size1 - 2+"px";
}
if (h_size1 > size)
{
el.style.height = h_size1 - 2+"px";
var newh = el.style.height;
alert("changing height to " + (h_size1 - 2) + "px");
alert("it is now " + newh);
setTimeout("animateHeightDown('" + id + "','" + size + "')", 1000);
} else {
if (ns6) {
document.getElementById("dwindowcontent").style.height = "1px";
}
}
}

loop one output is

h= 303 w= 165
changing height to 301px
it is now 301px

loop two output is

h= 303 w= 165
changing height to 301px
it is now 301px

etc
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top