Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change scrolling property of a frame

Status
Not open for further replies.

ejanakieff

Programmer
Sep 9, 2003
62
ES
I have an html page that contains two frames:

<frameset border="0" frameSpacing="0" rows="310,*" frameBorder="0">
<frame name="F1" src="page1.html" frameBorder="NO" scrolling="NO">
<frame name="F2" src="page2.html" frameBorder="NO" scrolling="NO">
</frameset>

I need to change with javascript the scrolling property of one of the frames. I need to put this property to "yes" if the resolution of the client monitor is 800x600. I know how to get the resolution of the client, but i can't change the value of the scrolling property of the second frame.

Thanks,
Eva Janakieff
 
This is purely speculation - because I never use frames. For the most part they are completely unnecessary (see here for more info: thread253-1180038)

If I were going to attempt this I would try something along the lines of:
Code:
document.frames[1].scrolling = "yes";

If you can't get this working I'd say you have 2 options: (I'd personally go with choice #2)
[ol][li]Always leave scrolling turned on[/li][li]scrap the frames idea and use a <div> instead and set the overflow value to auto[/li][/ol]

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Add "auto" for the frame that you want to scroll only when needed:

Code:
<frameset frameSpacing="0" rows="310,*">
<frame name="F1" src="page1.html" frameBorder="0" scrolling="no" />
<frame name="F2" src="page2.html" frameBorder="0" scrolling="auto" />
</frameset>


Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top