/    Sign up×
Community /Pin to ProfileBookmark

Frames and scrollbars

Dear all

I have a problem – probably stupidly simple, but I’m stuck 😮

I have a web page with 3 frames – a header with menu, a footer and a main frame.
My problem is the scrollbars when browsing in MS Internet Explorer… when a page is to large (high) to fit in the main frame, scrollbars occur – fine – but both the vertical and the horizontal bar shows even though the page only to high and not to wide.

I would have preferred that only the vertical scrollbar is shown.
(The horizontal one messes up the web pages layout.)

When using Opera as browser (which I use – and everybody else ought to use as well) this works fine …..

Here is the code I currently use:

[SIZE=2][FONT=Courier New]<frameset rows=”90,*” frameborder=”NO” border=”0″ framespacing=”0″>
<frame src=”Forside/meny/bsbk_meny_2.html” name=”topFrame” scrolling=”NO” noresize >
<frameset rows=”*
,80″ frameborder=”NO” border=”0″ framespacing=”0″>
<frame src=”Forside/bruks_aktivitetsplan.php” name=”mainFrame” noresize>
<frame src=”Forside/bruks_aktivitetsplan_footer.php” name=”bottomFrame” scrolling=”NO” noresize>
</frameset>
</frameset>[/FONT][/SIZE]

I will be very grateful if anyone could help me with this.

Regards
Espen ?

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyNov 04.2005 — how about you use a server side include and not frames. it will fix your trouble, most likely make the site look better, and be more accessibly friendly.
Copy linkTweet thisAlerts:
@djpavlikNov 04.2005 — Espen,

Once I had the problem which might be similar to yours. I had an iframe on the page and the task was to fit frame's content to its size.

The solution was to execute the following JS code in body.onload:
<i>
</i>document.getElementById('my_frame').contentWindow.clientWidth = '100%';

where [i]my_frame[/i] is an id of your frame.

Regards,

Roman
Copy linkTweet thisAlerts:
@Espen_BauthorNov 04.2005 — bathurst_guy: I have tought about it, but I'm not ready for that yet ?

djpavlik:

Tryd it - but it doesn't seems to work - but I'm not shure that I have put the code in the right place

[CODE]<script language="JavaScript" type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
</head>

<frameset rows="90,*" framespacing="0" frameborder="NO" border="0">
<frame src="Forside/meny/bsbk_meny_2.html" name="topFrame" scrolling="NO" noresize >
<frameset rows="*,80" frameborder="NO" border="0" framespacing="0">
<frame src="Forside/bruks_aktivitetsplan.php" name="mainFrame" noresize>
<frame src="Forside/bruks_aktivitetsplan_footer.php" name="bottomFrame" scrolling="NO" noresize>
</frameset>
</frameset>

<noframes><body onLoad="MM_callJS('document.getElementById('mainFrame').contentWindow.clientWidth = '100%';')">
</body></noframes>
[/CODE]
Copy linkTweet thisAlerts:
@djpavlikNov 04.2005 — Tryd it - but it doesn't seems to work - but I'm not shure that I have put the code in the right place
[/QUOTE]

Well, you think right ?

Because you've put <body> into <NOFRAMES> tag. If the browser supports frames then <NOFRAMES>...</NOFRAMES> is simply ignored and thats why body.onload never occurs. But in your case there's no other way to write <body> tag because you have a frameset(s).

So we will try to go another way. As far as know there is window's event [i]onload[/i]. So at the end of your html document put the following code:
<i>
</i>&lt;script&gt;
&lt;!--
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}

window.onload = function () {
// alert('called!'); // uncomment this line to make sure that this function is being really called
MM_callJS('document.getElementById('mainFrame').contentWindow.clientWidth = '100%';')
}
//--&gt;
&lt;/script&gt;
×

Success!

Help @Espen_B spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...