[Last Call] Learn how to a build a cloud-first strategyRegister Now


Dynamic Resize left frame in a frameset with php

Posted on 2004-11-24
Medium Priority
Last Modified: 2013-11-19
I am trying to resize the left frame in a frameset dynamicaly. I do not want to remove the left frame, only resize the width from 270 to 10 pixels. This is easy to do. My problem is to keep the content of the other frames when maximizing and minimizing the left frame with php.

I use this code with a minimize button and a maximize button:

$strekk = $_REQUEST['strekk'];
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


            <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">
            <meta name="generator" content="My Page">
            <title>My Page</title>

      <frameset border="0" bordercolor="#dddddd" frameborder="no" framespacing="0" cols="<?PHP echo $strekk?>,*">
            <frameset border="0" bordercolor="#dddddd" cols="*,10" frameborder="no" framespacing="0" rows="*">
                  <frameset border="0" bordercolor="#dddddd" frameborder="no" framespacing="0" rows="17,*">
                        <frame name="Navi head" scrolling="no" src="navi_head.php">
                        <frame name="Navi" src="navi.php">
                  <frame name="Mellombak" scrolling="no" src="mellom.php">
            <frameset border="0" bordercolor="#dddddd" frameborder="no" framespacing="0" rows="28,*">
                  <frame name="Menu" scrolling="no" src="menu.php">
                  <frame name="Data" noresize src="index.php">

                  <body bgcolor="#ffffff">



Do anyone know a way to do this?
Question by:Hans Inge Hagen

Expert Comment

ID: 12663232
You can achieve this with javascript.

Check this url for examples:

Author Comment

by:Hans Inge Hagen
ID: 12663495
I am not able to see how this script can keep the content (example: you navigate to a page and the main frame change content). I need it to be a toogle button where I can hide the navigation if needed and keep the mainframe content. Anyway, thanks for the reply!

Accepted Solution

alexmay earned 200 total points
ID: 12665626
I agree with b_loco, you can do it with javascript.
What is wrong with these two files as an example?

        <frameset name= "totalFrame" id="totalFrame" cols=270,*>
                <frame src="side.html" name="side" id="side" >
                <frame src="" name="main" id="main" > 

side.html :

<script language="javascript">
function toggle() {
if (parent.document.all("totalFrame").cols=="50,*") {
} else {
<button onclick='toggle();'>toggle</button>
     <br> <a href="http://www.cnn.com" target='main'>cnn</a>

The toggle works and the main frame can change its content as much as you like.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question