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 Frame Size via Javascript 1

Status
Not open for further replies.

jammer1221

Programmer
Jul 30, 2003
352
US
Hey all,

I have created a frameset with 5 frames, divided out vertically. So I have 5 columns each at 20%.

My question is: is it possible to change the size of two different frames using javascript?

I would like, for example, to change the first frame to have a width of 5% and the third frame to 35%. The total width is still 100%. I've looked around on google but can't find anything.

So I was hoping one of you guys had an idea.

Thanks,
Matt
 
Well right now I have a function that is triggered whenever the mouse is clicked in the page that is in the frame.

...
Code:
<body onClick="myFunction()">


My next question, assuming you can dynamically change the frames size, is to detect its current size. So whenever the frame is clicked it will change size unless its a certain size.

Thanks,
Matt
 
to manipulate the size of a frameset, you can try something like this:

Code:
parent.document.getElementById('frameSetId').cols = '150,*';

as long as that code is not in the framset document itself, and the frameset document has a frameset with an id of "frameSetId".



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Oh Hallelujah, it worked!

Thank you so much. I've been working on this forever. There is not alot of documentation on the web, or maybe I wasn't using the right search terms.

Either way, you solved my problems.

Thank you very much.

Matt
 
Oh, one last question: How do you get the column size of the current frame.

Thanks,

Matt
 
Hey cLFlaVA,

Thank you for all the help!

I have figured out how get the size, atleast for the project I'm working on.

I just wanted to let you know, and to say thanks again.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top