Dynamic Resize left frame in a frameset with php

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:

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

<html>

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

      <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">
                  </frameset>
                  <frame name="Mellombak" scrolling="no" src="mellom.php">
            </frameset>
            <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">
            </frameset>
            <noframes>

                  <body bgcolor="#ffffff">
                        <p></p>
                  </body>

            </noframes>
      </frameset>

</html>

Do anyone know a way to do this?
Hans Inge HagenOwner and programmerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

b_locoCommented:
You can achieve this with javascript.

Check this url for examples:
http://developer.irt.org/script/787.htm
0
Hans Inge HagenOwner and programmerAuthor Commented:
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!
0
alexmayCommented:
I agree with b_loco, you can do it with javascript.
What is wrong with these two files as an example?

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


side.html :

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

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.