Forum Moderators: open
I have created a site that uses an iframe for changing content. I use javascript to assign the height of the left side of the background and to change the height of the iframe after the content is loaded. This is done to avoid the Netscape 6 - 6.2.3 problems with not being able to assign a percentage height to the iframe.
The resizing code works well save for two things:
1. I have some iframed content that includes references to a page jump on another iframed page (ie. - <a href="../shared/topics.html#Measurement">) Before using the resizing code, the page to which it was linking would load in the iframe but not jump to the anchor. Now, in Netscape 6+, with the new resizing code, the content at the anchor appears at the very top of the iframe, cuts off whatever was supposed to be above it, and that amount of whitespace appears at the bottom of the iframe. This only happens when linking to another page using a page jump. Other links work fine.
2. Now that I'm dynamically changing the height of the iframe, the table within which it is contained also changes height. In Netscape 6.2.3, this is now causing a different problem. I have assigned fixed heights for the top two rows of the table since I don't know how tall the table is going to be and I don't want those two rows to grow or shrink. However, that is exactly what is going on in Netscape 6.2.3. I understand that it is resizing the table height, but it shouldn't be resizing the height of those two rows. I've tried assigning a class to the cell in those rows (these are one celled rows), assigning a class to the row, assigning the height directly to the row and the cell...I even tried making them one cell. Nothing works in Netscape 6.2.3.
I do all programming by hand, NO HELP FROM SOFTWARE, so I know my code is lean and clean.
Issue #1 -- this confuses me. The behavior you describe sounds like the proper behavior for an internal named anchor. We've had other threads here where people had trouble getting browsers to do what you described - having the content from the named anchor on appear at the top of the iframe. Have I misunderstood you?
Issue #2 -- according to the W3C, browsers are allowed to take the author's height and width instructions for tables and table cells as a "suggestion", and are not asked to take them as a rule. This is necessary to keep the internal browser code from getting stuck in situations where conflicts are inherent in the HTML.
Netscape has always been a lot looser in regard to how easily it abandons the author's suggested height. If this Netscape behavior is an important layout snafu for this page, you'll probably need to rethink the way the layout is achieved.
You might also play around with the DTD - you didn't mention what version of [X]HTML your page is written in, so maybe this isn't a possibility. Sometimes that can make a difference in detailed rendering problems.
1. I'm happy that the anchor appears at the top of the page. However, it cuts off all the content above the anchor. As in, its not there any more. If for example, you jump to an anchor that is normally 1/2 way down the page, the anchored content will appear at the top, and 1/2 a page's worth of white space appears at the bottom of the iframe. I don't know if its allowed, but I could take a screenshot and post it here as its hard to imagine without seeing it.
The problem does appear to be related to having a height in place before the page is done loading. If the frame height is set before the page finishes loading, the problem of the top of the page getting cut off is fixed, but then again, the anchored text isn't at the top of the page.
I tried setting location.hash, changeme(which is the iframe's name).document.location, etc. Nothing worked. Page jumps to parts of the same page don't work, but they don't have the same problem.
I've looked all over on Google for any information about Netscape problems with height, anchors, iframes, and linking. I found squat.
2. It is a problematic layout snafu but I'm stuck with it for now. Its plain old HTML, which I've tried to make as standards compliant as possible. I've never touched a DTD.