Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with screen.availHeight in IE8?

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I created a simple html page with a text box and an unordered list. I want the top of the unordered list to be located at the same y coordinate as the top of the text box. However, if part of the unordered list falls below the window, I want the bottom of the unordered list to line up with the top of the text box. Consequently, I add textbox.offsetTop + unorderedlist.offsetHeight and check to see if the result is greater than screen.availHeight. Although the calculation indicates that the result is < screen.availHeight, when displayed, part of the unordered list falls below the page. In my case screen.availHeight = 860. However, if I expand a button, for example, so that it is the same length as the page, it gives a height of 710.

I'm running this on IE8. One other note. The display property of the unorderedlist is set to "none". As a result, I don't get any x/y values. But when I set the display to "", then I have x/y values. So, I set display to "block" prior to my calc. Then I set it to "none" after my calc. Regardless, availHeight equals 860 prior to and after setting the "display" property.

I don't get it. Is there a bug in IE8 that would cause this ptoblem? Or, am I doing something stupid? Or does someone have a solion?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top