Click to See Complete Forum and Search --> : odd sizing problem


anarchist
06-20-2003, 09:10 AM
I dont understand how this happens but sometimes one of the div I use to form my navigation bar decides to be 20 pixels too big(exactly the size of the little bar above it), this used to display fine so I'm not sure how I've broke it, but if the page is resized it fixes itself

my page is set up as
<div id="pushpin" style="BORDER-RIGHT: thin inset; PADDING-RIGHT: 2px; BORDER-TOP: thin inset; DISPLAY: block; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: thin inset; WIDTH: 80px; PADDING-TOP: 2px; BORDER-BOTTOM: thin inset; HEIGHT: 20px; BACKGROUND-COLOR: #cccccc" align=right><input type=image id="PP" src="images/PushPinout.gif" onclick="togglePushPin()"></div>
<div id="OB" style="LEFT: 0px; PADDING-TOP: 20px; POSITION: absolute; TOP: 0px; HEIGHT: 100%">
<div id="OutlookBar" align="center" height=100%>
<div id="upScroll" onclick="ScrollUp()"><img src="images/but_scroll_up.gif" /></div>
<div id="downScroll" onclick="ScrollDown()"><img src="images/but_scroll_down.gif" /></div>
</div>


with javascript to scroll the contents of the outlook bar - also generated by javascript
this si the code that seems to cause the problem

function ScrollUp()
{
document.all["g"+CurrentGroup+"Items"].style.top=document.all["g"+CurrentGroup+"Items"].offsetTop+70
if(document.all["g"+CurrentGroup+"Items"].offsetTop!=20)
{
document.all["g"+CurrentGroup+"Items"].style.clip="rect("+Math.abs(document.all["g"+CurrentGroup+"Items"].offsetTop-20)+", 100%, 100%, 0)"
}else
{
document.all["g"+CurrentGroup+"Items"].style.clip="rect(0, 100%, 100%, 0)"
}
DrawScrollers()
}

function ScrollDown()
{
document.all["g"+CurrentGroup+"Items"].style.top=document.all["g"+CurrentGroup+"Items"].offsetTop-70
if(document.all["g"+CurrentGroup+"Items"].offsetTop!=20)
{
document.all["g"+CurrentGroup+"Items"].style.clip="rect("+Math.abs(document.all["g"+CurrentGroup+"Items"].offsetTop-20)+", 100%, 100%, 0)"
}else
{
document.all["g"+CurrentGroup+"Items"].style.clip="rect(0, 100%, 100%, 0)"
}
DrawScrollers()
}


can anyone tell me why if I scroll down too far my outlookbar div decides to grow?

anarchist
06-20-2003, 10:57 AM
still dont know why it happens but I've got a work arround now


document.all["OutlookBar"].style.height=document.all["OutlookBar"].offsetHeight-20
document.all["OutlookBar"].style.height="100%"


just makingn the div smaller then setting it back to full size forces it back to the height it was meant to be