[B]FINAL UPDATE: The problems described in this message were caused by two issues. I will describe them here so it may help others in the future.
1.
Contrary to various web articles I read, the “height: auto” CSS style attribute can NOT be assumed to be assigned to DIVs by default. In my case, Firefox didn’t assign the “auto” setting by default to my “content” div while IE did. I had to explicitly set it in my style sheet for it to work as expected in both browsers.
The [URL=http://www.deluxe-menu.com]Deluxe-Menu component
==== Original post follows ====
Hello all,
First, thanks in advance for any advice offered!
I have a site I’m developing ([URL=http://www.tommyb.com/gsc/]http://www.tommyb.com/gsc/
[CODE]#SiteBuffer
{
position: absolute;
visibility: hidden;
display: none;
left: 0;
top: 0;
}
The contents are copied to a “content” div on the main page via InnerHTML once they are loaded into the hidden iFrame. This div doesn’t have any special properties as far as absolute positioning or sizing. Its style is:
[CODE]body
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #F3EC67;
background-color: #000080;
margin:5;
padding: 0;
}
#SiteContent
{
color: #000080;
background-color: #D6BF5B;
}
I have also encapsulated the site menu in an absolutely-positioned div. I reposition it as users scroll up and down the page so it will stay in view. Here’s the CSS style for it:
[CODE]#SiteMenu
{
position: absolute;
left: 6;
top: 100;
z-index: 100;
}
Here’s the div positioning Javascript code:
[CODE]function adjustMenus()
{
document.resetMenuPos = false;
var startY = findPosY(getElement(‘SiteContent’)); //set y offset of bar in pixels
var ns = (navigator.appName.indexOf(“Netscape”) != -1) || window.opera;
function ml(id)
{
var el = document.getElementById(id);
el.style.visibility = “visible”;
if (document.layers)
el.style = el;
el.sP=function(y) {this.style.top = y + “px”;};
el.y = startY;
return el;
}
window.stayTop = function()
{
ContentDiv = getElement(‘SiteContent’);
startY = findPosY(ContentDiv); //set y offset of bar in pixels
pY = (ns ? pageYOffset : getIEDocBody().scrollTop) + 5;
ContentBottom = startY + ContentDiv.offsetHeight;
ftlObj.y += ((pY > startY ? pY : startY) – ftlObj.y) / 5;
// Ensure new position is inside the top and bottom positions of our content div
if (ftlObj.y < startY || document.resetMenuPos == true)
ftlObj.y = startY;
else if (ftlObj.y + ftlObj.offsetHeight > ContentBottom)
ftlObj.y = ContentBottom – ftlObj.offsetHeight;
document.resetMenuPos = false;
ftlObj.sP(ftlObj.y);
setTimeout(“stayTop()”, 15);
}
ftlObj = ml(“SiteMenu”);
stayTop();
}
[B]Here’s the problem:
It also works correctly from the bottom of the page if the new page content is greater than the previous content. The “content” div shows all the newly-loaded content and the scroll range is correct.
However, the page scrolling range will extend beyond the bottom of the page if the new page content is less than the previous content, but only if you selected the menu link while viewing the bottom of the page.
[B]TO TEST THE PROBLEM:[I]The problem should be apparent after scrolling to the bottom of the default “This Week” page and selecting the “About” link.
Some additional info:
–
The behavior is consistent across both IE and Firefox.
If you select all of the page content, nothing is selected below the page footer, which suggests there aren’t any extraneous carriage returns or spaces causing the page to be incorrectly extended.
I have examined the page content with Firefox’s DOM Inspector once it is incorrectly extended. None of the div coordinates exceed the correct page bottom value.
Pressing the “End” key multiple times causes the page to scroll further down once the page is incorrectly extended.
I attempted to fix this by repositioning both the scroll position back to the top of the page (via window.scrollTo(0,0)) and the menu prior to loading the new content into the hidden iFrame. These changes had no effect on the problem.
Again, thanks for any help on this. I’ve spent about 6 hours trying to figure out the problem and I’m stumped!
Tom Baggett
[B]UPDATE: