• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Fun with frames

Hi,

I was recently given this answer  from GwynforWeb as to how to collapse a menu frame.


"
Put this link where ever you want in the frames pages to make  the frame called frameName fill the whole window

   <a href="#" onclick="top.location=top.frames['frameName'].location.href;return false">Remove Frames</a>
"

----

Is it possible to collapse 1 frame and open another in a relatively smooth way.

For example, say I have 2 frames, 1 is a left menu, other is main, can I collapse left menu and open a right menu frame without reloading the main page?

0
macuser777
Asked:
macuser777
  • 3
  • 3
1 Solution
 
COBOLdinosaurCommented:
Yes you an do it dynamicallly with script this way:

for the left to show full page:

parent.document.body.cols="100%,*";
for the right to show full screen:
parent.docuemnt.body.cols="*,100%";

for a slow transition effect you can use:

<script type="text/javascript">
   var curdnval=100;
   // set this value to the starting percentage of the side you will be hiding

   function dochg()
   {
      curdnval --;
      curdnval --;
      parent.document.body.cols=curdnval + "%,*";
      if (curdnval>0)
      {
         setTimeout('dochg()',50);
      }
   }
</script>

and of course you can reverse it as well.

Tested on IE6 and FF.


Cd&
0
 
macuser777Author Commented:
Hi,

Can't quite figure how to apply this. I may have got mixed up. My intention is.....

I have a frameset with 3 frames, these names

left - main - right

Initially I want the page to load with

left - main

and a link in left so that page can become

main - right

and a  link in right to switch back to

left - main.


Also, both left and right would have a link like this

"#" onclick="top.location=top.frames['frameName'].location.href;return false">Remove Frames</a>
0
 
macuser777Author Commented:
I meantt

 left and right would have a link like this

   <a href="#" onclick="top.location=top.frames['frameName'].location.href;return false">Remove Frames</a>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
COBOLdinosaurCommented:
This line of script changes the framesetup:

parent.document.body.cols="whatever new cols value you need";

You just need to change the value of the cols attribute in the frameset, and that is one that line of code does.

As for this:
<a href="#" onclick="top.location=top.frames['frameName'].location.href;return false">Remove Frames</a>


What you want is:
<a href="#" onclick="top.location=top.frames['frameName'].location.href;return false">Remove Frames</a>

<a href="#" onclick="this.href=top.frames['framename'].location.href" target="_top">
Remove Frames</a>

Cd&



0
 
macuser777Author Commented:
Thanks

macuser
0
 
COBOLdinosaurCommented:
Glad i could help. Thanks for the A. :^)

Cd&
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now