tags:

views:

140

answers:

3

Hi,

I have designed a frame in a window. The frame size is fixed. I dont have/dont want a scroll bar for the frame. If the Text overflows in the frame,I want to have a windows scrolll bar instead of a frame scroll bar for controlling the overflowing part.

thnks..

+1  A: 
scrolling="no"

will prevent the iframe from displaying the scroll bar.

But the second part of your question seems confusing.

rahul
Is the inline method better than using the overflow attribute via CSS? I seem to remember having trouble with an iframe in IE. FF and Opera adhered to the style rules, but IE was (as usual) ignoring some of them.
Anthony
in a frame scrolling="no" will prevent the scrollbar from appearing, but the content that exceeds the frame size will be hidden instead of expanding the frame.
awe
A: 

What is the difference between a windows scrollbar and a frame scrollbar?

Do you mean you want the entire page to scroll, not just the frame? Kind of like what Google Video does?

Have you tried:

overflow: scroll;

That makes a scroll bar for just the frame/div that has overflow, so that might be opposite of what you want. But anything more than that would depend on the situation. For instance:

 =============================================================
 |                                                           |
 |       Frame with text.                                    |
 |       Maybe it doesn't fit into frame height.             |
 |-----------------------------------------------------------|
 |                                                           |
 |                                                           |
 |                Main Page                                  |
 |                                                           |
 |                                                           |
 |                                                           |
 |                                                           |
 =============================================================

Now, how would the user scroll down that top frame if the scroll bar is along the entire page?

Also, if you are using actual frames, ie a frameset, you should probably consider ditching that for positioned divs. Not just because I'm less familiar with framesets, but also because frames are quickly becoming obsolete for css-based alternatives.

Anthony
A: 

By frame, do you mean an iframe? I guess what you want is that the height of the iframe depends on the content page inside? This is not possible (sorry). The same if your frame is a normal frame in a frameset. The sizes of the frames are allways defined by size proprties on the elements (or frameset cols/rows), it can never be dynamically dependent of the size of the page within. What you can do is define the height of your frame large enough to allways contain the full page within, but then you will allways have a window scrollbar that reflects the full height of the size you defined on the fram, even if the contents does not require it.

awe
With javascript you COULD have the frame resize on page load, based on the height of the inner-iframe, except you can't because it violates the cross-domain scripting rules. But I thought I'd mention it because in non-iframe situations, where the "frame" is just a div, you could resize dynamically.
Anthony