Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

I have a frame set farem1, frame2,frame 3

when frame one is visible, frame 2 is hidden and vice virce. The size should be the same. How can i do it
I have not many point available.

Thank you
0
nesifa
Asked:
nesifa
1 Solution
 
bebonhamCommented:
what do you mean hidden...

how many frames are visible at a time, and how much space of the screen do they take up.

Bob
0
 
kllewelynCommented:
Is the content of the frames static? Give me an understanding of the overall project.

Thanks
0
 
nesifaAuthor Commented:
two frames are visible at a time.

<frameset border=0 cols="100%,*">
     <frame name="1" src="1.htm">
        <frame name="2" src="2.htm">
        <frane name="3" scr="3.htm">
</frameset>
I want frame 1 and 2 to take the smae space(amount and position the smae"
based in what I click frame 1 is visible and then frame 2 is hidden.

Thank you
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
nesifaAuthor Commented:
two frames are visible at a time.

<frameset border=0 cols="100%,*">
     <frame name="1" src="1.htm">
        <frame name="2" src="2.htm">
        <frane name="3" scr="3.htm">
</frameset>
I want frame 1 and 2 to take the smae space(amount and position the smae"
based in what I click frame 1 is visible and then frame 2 is hidden.

Thank you
0
 
kllewelynCommented:
OK, I have 3 frames, 1 frame controls the other 2. Let me know if this is close to what you are looking for.

Save this as frames.html:
<html>
  <head><title>Hide 1 show the other</title>
  </head>
  <frameset framespacing='0' frameborder='1' cols='33%,33%,34%'>
    <frame src='hidden.html' frame name='frame1'>
    <frame src='hidden.html' frame name='frame2'>
    <frame src='choose.html' frame name='frame3'>
  </frameset>
</html>

Save this as choose.html:
<html>
<body>
<script type="text/javascript">
  function showFrame(x)
  {
    eval("parent.frame"+x+".location.href='visable.html'");
  }
  function hideFrame(x)
  {
    eval("parent.frame"+x+".location.href='hidden.html'");
  }
</script>
<input type="button" value="Frame1" onclick="showFrame(1);hideFrame(2)">
<input type="button" value="Frame2" onclick="showFrame(2);hideFrame(1)">
</body>
</html>

Save this as visable.html:
<html>
<body>
You can see me!
</body>
</html>

Save this as hidden.html:
<html>
<body>
</body>
</html>

Place all of these in the same directory and browse to frames.html. When you click on the button frame1, frame1 will show the visable page and frame2 will show the blank page(hidden) if you want to actually hide the contents of the frame and not replace the href then you need to use iframes or div areas within the frames.

Let me know.




0
 
nesifaAuthor Commented:
hi klevellin,
It looks okay so far.
visable and hidden frames I want to take up the same space, the same absolut position.
I do not want to have div tags in the same frame. The design requires both of frames be loaded on the same position, while one is visible the other one is hidden. I load two OCXs. OCx on one frame remains always the same, ocx in the other frame is variable. That is the reason that I do not use div tags, because of not loading more than two ocx at a time in the memory.

Thank you
0
 
kllewelynCommented:
OK, so you should be able to just change the href for the frame with the desired ocx page.
0
 
kllewelynCommented:
How about this?

save as frames.html:
<html>
  <head><title>Hide 1 show the other</title>
  </head>
  <frameset framespacing='0' frameborder='1' cols='50%,50%'>
    <frame src='choose.html' frame name='mainFrame'>
    <frame src='hidden.html' frame name='ocxFrame'>
  </frameset>
</html>

Save as choose.html:
<html>
  <head><title>Hide 1 show the other</title>
  </head>
  <frameset framespacing='0' frameborder='1' cols='50%,50%'>
    <frame src='choose.html' frame name='mainFrame'>
    <frame src='hidden.html' frame name='ocxFrame'>
  </frameset>
</html>

save as ocx1.html:
<html>
<body>
I am OCX #1
</body>
</html>

save as ocx2.html:
<html>
<body>
I am OCX #2
</body>
</html>

This allows only 2 ocx's to be in memory at the same time. the page you load into frame 1 and the variable 1 that gets loaded into frame 2, based on the user selection.

Let me know.

0
 
kllewelynCommented:
How about this?

save as frames.html:
<html>
  <head><title>Hide 1 show the other</title>
  </head>
  <frameset framespacing='0' frameborder='1' cols='50%,50%'>
    <frame src='choose.html' frame name='mainFrame'>
    <frame src='hidden.html' frame name='ocxFrame'>
  </frameset>
</html>

Save as choose.html:
<html>
  <head><title>Hide 1 show the other</title>
  </head>
  <frameset framespacing='0' frameborder='1' cols='50%,50%'>
    <frame src='choose.html' frame name='mainFrame'>
    <frame src='hidden.html' frame name='ocxFrame'>
  </frameset>
</html>

save as ocx1.html:
<html>
<body>
I am OCX #1
</body>
</html>

save as ocx2.html:
<html>
<body>
I am OCX #2
</body>
</html>

This allows only 2 ocx's to be in memory at the same time. the page you load into frame 1 and the variable 1 that gets loaded into frame 2, based on the user selection.

Let me know.

0
 
kllewelynCommented:
sorry about that, this should be the choose.html file:
<html>
<body>
<script type="text/javascript">
  function changeFrame(x)
  {
    eval("parent.ocxFrame.location.href='ocx"+x+".html'");
  }
</script>
<input type="button" value="OCX1" onclick="changeFrame(1)">
<input type="button" value="OCX2" onclick="changeFrame(2)">
</body>
</html>

0
 
webwomanCommented:
you don't 'hide' frames -- you just load another document into them. If you want the content to change, make a link that loads another page. That's what's been proposed, and that's the ONLY way you can change what's shown in a frame.

If, however, you don't want to use frames, but want ONE document with layers that show/hide, that's something ENTIRELY different.
0
 
nesifaAuthor Commented:
yes, but I did it my self by changing top.document.body.cols="25,0,250"
0
 
kllewelynCommented:
But you said you only wanted 2 ocxs to be loaded at once. if you simply decrease the size of a frame the ocx is still loaded.
0
 
nesifaAuthor Commented:
yes, in one frame I keep one OCX forever, the other frame I just change different OCX, in the third frame I have the clicable buttons. If you come with a better Idea, please let me know. Thank you
0
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.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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