Dynamic Resize left frame in a frameset with php

Posted on 2004-11-24
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
    LVL 2

    Expert Comment

    You can achieve this with javascript.

    Check this url for examples:

    Author Comment

    by:Hans Inge Hagen
    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!
    LVL 2

    Accepted Solution

    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="" target='main'>cnn</a>

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

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Preface In the first article: A Better Website Login System ( I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
    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.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now