Solved

I have a frame set farem1, frame2,frame 3

Posted on 2001-06-12
14
240 Views
Last Modified: 2012-06-27
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
Comment
Question by:nesifa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 8

Expert Comment

by:bebonham
ID: 6183076
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
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6183084
Is the content of the frames static? Give me an understanding of the overall project.

Thanks
0
 

Author Comment

by:nesifa
ID: 6183099
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:nesifa
ID: 6183200
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
 
LVL 1

Accepted Solution

by:
kllewelyn earned 5 total points
ID: 6183302
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
 

Author Comment

by:nesifa
ID: 6183416
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
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6183482
OK, so you should be able to just change the href for the frame with the desired ocx page.
0
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6183644
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
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6183657
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
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6183662
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
 
LVL 19

Expert Comment

by:webwoman
ID: 6185819
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
 

Author Comment

by:nesifa
ID: 6187276
yes, but I did it my self by changing top.document.body.cols="25,0,250"
0
 
LVL 1

Expert Comment

by:kllewelyn
ID: 6187295
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
 

Author Comment

by:nesifa
ID: 6190908
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 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