How to remove iframe vertical scrollbar AND it's position space?

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Hi,

Need some tip with a iframe over here ...

I'm using the following code:

<iframe id="frameSideContent" width="100%" height="170px" src="http://localhost/testWeb/Servlet" frameborder="0" framespacing="0" marginheight="0" marginwidth="0"></iframe>

That's supposed to bring a iframe "zone" with an independent web page (created by the servlet). That page will have some links, that will refresh itself with new content, without disrupting the global page the user is seeing.

The problem is that, no matter what I do, I cannot remove the vertical scrollbar of the iframe ... with the above frameborder setting the vertical scrollbar doesn't appear, but still there is a reserved blank space for it ...

How can I remove the vertical srollbar AND avoid it's space position from being reserved/displayed? (it just breaks up my page layout).

Thank you
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
Sorry I don't know the answer to your question off the top of my head, but I just wanted to say that iframes aren't the most popular because some browsers won't display them properly, sometimes not at all. Might be more of an issue if your users are using old browser versions. You also may not see your specific issue in different browsers, not sure what you've tried since you don't say what you are testing with.
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Compatibility is an issue, since this is for a webpage. Currently I'm testing with IE and FireFox, and IE seems to give the issue ... the contents are resized using percent width on tables, and the height will never be bigger than the iframe's height, so I see no need to appear a vertical scrollbar. Once more, IE ruining layouts!

I know iframes can give their issues, and also frames ... but can you give me an idea on how to avoid them?

I mean, imagine a main web page, and there is a small section that will display a calendar. It has 2 buttons, for "next month" and "previous month". Those buttons will refresh that section data. I don't want to refresh all the webpage contents, just the section of the calendar ... so which would be the safest way of doing it? If using iframe to access the content as a url, that sub-page would submit to "_self" so it would just refresh itself, not the main content page.

Thanks for any help :)
 

b4u

Golden Member
Nov 8, 2002
1,380
2
81
Originally posted by: b4u
Compatibility is an issue, since this is for a webpage. Currently I'm testing with IE and FireFox, and IE seems to give the issue ... the contents are resized using percent width on tables, and the height will never be bigger than the iframe's height, so I see no need to appear a vertical scrollbar. Once more, IE ruining layouts!

I know iframes can give their issues, and also frames ... but can you give me an idea on how to avoid them?

I mean, imagine a main web page, and there is a small section that will display a calendar. It has 2 buttons, for "next month" and "previous month". Those buttons will refresh that section data. I don't want to refresh all the webpage contents, just the section of the calendar ... so which would be the safest way of doing it? If using iframe to access the content as a url, that sub-page would submit to "_self" so it would just refresh itself, not the main content page.

Thanks for any help :)


Any ideas?

I've tested right now with IE vs FF. In IE, the scrollbar (vertical) allways takes place, and if I do scrolling="yes" I force it to appear. In FireFox, since the contents will never need a scrollbar (neither vertical or horizontal), it just uses that extra space for content ... the way it should be in the first place ... and even if I place scrolling="yes", FF will never place the scrollbar, since it can see that it's not needed.

So right now, I have scrolling="yes", but since the display is different on IE vs FF, I would like to make it uniform. Taking out the bar on IE, or forcing it to appear on FF ...

Thanks for any tips :)