Frame Scrolling vs. Mozilla Firefox 1.0.2
I hope someone can give me a solution to this.
I've got a site constructed out of 2 frames placed vertically below each other. The top frame is 249 pixels high and should not scroll. The second frame below shall be scrollable if needed. Both frames are containig tables aligned in the center. What happens with Firefox is: When the second frame needs to be scrolled the scrollbar appears on the right and shift the frame's contents a few pixels to the left. At the same time the top frame's content keeps it's original position ... So at the end the content of the two frames is not aligned exactly below each other as intended but the top one is more on the right and the lower frame is more on the left. This is the doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> Here's some of the code of the my index.html: :: Code ::
<frameset rows="249,*" border="0" frameborder="no" framespacing="0" > <frame name="buttons" target="index_contentFrame.html" src="index_topFrame.html" noresize scrolling="no"> <frame name="content" src="index_contentFrame.html" target="_self" noresize scrolling="auto"> <noframes> And here's an example of my top frame code: :: Code ::
<body background="images/bg.jpg" bgcolor="#FFFFFF" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0"> <table width="762" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="ffffff" height="207"> </table> </body> And here's an example of my lower frame code: :: Code ::
<body background="images/bg.jpg" bgcolor="FFFFFF" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0"> <table width="760" height="400" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="ffffff"> </table> </body> I'd be glad about just any hints about what I'm doing wrong. The aim is to have the centered table in frame nr. 2 aligned perfectly below the centered table in frame nr. 1 even when scrolled. Thank you. Back to top |
|||||
You're not doing anything wrong, except for using frames in the first place, which is what is causing all these issues.
The problem you are describing would be corrected by not using frames. I'm actually surprised that despite the technical drawbacks of frames, people still keep trying to use them. The scrollbar takes about 20 pixels, and if it's always there, which it would have to be for the following to work, you can simply match that 20 pixels on the bottom frame with a corresponding margin-right:20px; on the top frame source page. That's CSS, placed on the primary page content container, can be a div, whatever. However, then you have to have the bottom frame set to scrolling="yes" to make sure the scroll bar is always there. Frames always involve many compromises, it's funny, I used to love frames, but always ignored the sacrifices in functionality I was actually making. My current guess is that over 90% of all frames are used simply because the person making the site isn't aware of, or isn't comfortable with, using a server side include, like with php, to deal with shared code, like headers, navs, etc. That's how you really do it, avoids all those issues in the first place. Back to top |
|||||
Oh, thank you for your replay.
I have already tried to set the bottom frame to scrolling="yes". But still the scrollbar wasn't present when "not needed" as it is in the case of scrolling="auto"... it seems not to work with Mozilla. With IE it works fine. Maybe I really should get rid of the frames, and save time solving things which have technical drawbacks. I'm not a guru in this at all, so I just thought frames would be a good solution for my Flash Intro + navigation frame, and the actual content frame. For I didn't want each page of the site to be reloaded with the Flash again and again. Have you got any idea how to do this in another better way? If you can give me a tip, I'll find some information somewhere on the web to save you time explaining. Thanks in advance! Back to top |
|||||
My observation defining scrollbars concerning Firefox is that:
1. 'no' means no 2. 'auto' means auto 3. 'yes' means auto But I really coudn't find a way to make a scrollbar in bottom frame permanent. Back to top |
|||||
:: Quote :: Maybe I really should get rid of the frames, and save time solving things which have technical drawbacks. To make things simple, there are basically nothing but drawbacks when using frames, much as I like them. There are certain very specific applications where frames are very useful, but those aren't very common. A flash intro should be just that, an intro. What users are generally looking for is one of the following:
Frames cause nothing but serious problems in terms of search engines, these problems, while they can be solved if you know how to do it to some degree, can never be fully fixed, and it's very hard to fix them on a practical level. Page performance actually is much worse with frames, that's because for each single apparent page, you are loading at least 3 pages, each of which must be sent to the user browser as a single file. The browser then takes these pieces and puts them together, creating the illusion of a single page. The real way to do this is to use server side programming like PHP to build the page pieces from chunks of HTML, or other, more complex methods, then have the server send the requesting browser that single file. Since each page is technically completely separate from the others, what is indexed by search engines is each separate page, not the overall page. Frames create an illusion of unity, a single page, but their problems are not illusions, they are very real, and almost all have their source in the illusion of having a single page with different parts, this isn't what you have really, what you have is 3 or more separate pages. Rather than create an illusion, it's generally much more stable and reliable to simple create a single, real, unitary page. That resolves almost all the issues you would have had with frames. Generally if you find yourself wanting to use frames or iframes, it may be a good idea to step back and ask yourself if that's really the best way to handle the issue. Usually it isn't, sometimes it is. I use them, but generally only in login areas where search engines are not a question. Making the bottom scrollbar permanent won't be reliable for a very simple reason: the only situation that's needed is for presentation matters, which are basically irrelevant in terms of the underlying function of the page, so how that will be treated can vary browser to browser, since it's just a cosmetic thing. Also keep in mind this: a flash intro will not score you any points with a search engine, and, if not done correctly, will in fact block the search engines from your site completely. So a reasonably successful project may not even see any visitors to the home intro page. For example, on this site, only about 1.5% of all site visitors ever see the home page. Back to top |
|||||
All times are GMT - 8 Hours
|