/    Sign up×
Community /Pin to ProfileBookmark

odd sizing problem

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

[CODE] <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>
[/CODE]

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

[CODE] 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()
}
[/CODE]

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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@anarchistauthorJun 20.2003 — still dont know why it happens but I've got a work arround now

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


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

Success!

Help @anarchist spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...