If I have a div set as follows:
<div id="div_1" style="position :absolute; z-index:1; left:33px;
top:177px; height:20px; width:910px; visibility:visi ble;
overflow:hidden ; border:1px solid red;">alot of content here that varies
in length</div>
and trying to incrementally reveal the content using the following
javascript until the height is equal to "222"
function extend()
{
var obj = document.getEle mentById('div_1 ')
var amt = "222";
setTimeout(int_ a, 100);
function int_a()
{
var currH = obj.style.heigh t
var currHS = currH.split("px ")
if ( parseInt(currHS ) < amt )
{
var newH = (parseInt(currH S)+1) + "px"
obj.style.heigh t = newH
setTimeout(int_ a, 50);
}
}
}
How to I make a change to reveal the content until all the content is
revealed instead of harcoding a value like I have done above?
Mike
<div id="div_1" style="position :absolute; z-index:1; left:33px;
top:177px; height:20px; width:910px; visibility:visi ble;
overflow:hidden ; border:1px solid red;">alot of content here that varies
in length</div>
and trying to incrementally reveal the content using the following
javascript until the height is equal to "222"
function extend()
{
var obj = document.getEle mentById('div_1 ')
var amt = "222";
setTimeout(int_ a, 100);
function int_a()
{
var currH = obj.style.heigh t
var currHS = currH.split("px ")
if ( parseInt(currHS ) < amt )
{
var newH = (parseInt(currH S)+1) + "px"
obj.style.heigh t = newH
setTimeout(int_ a, 50);
}
}
}
How to I make a change to reveal the content until all the content is
revealed instead of harcoding a value like I have done above?
Mike
Comment