Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Changing frame size

Posted on 1998-03-12
8
Medium Priority
?
1,442 Views
Last Modified: 2012-06-22
I have HTML page with 2 frames. The problem I have is that I want to
change the size (width) of frames when user clicks on something (link)
in one of the frames. In the begining both frames have the same width,
but after user click I want one frame to shrink and the other to grow.
Is that possible in javaScript? If not, how could i do something like this?
0
Comment
Question by:marko020397
[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
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1278614
No, you cannot do it.

The simplest way to achieve that effect is make your link refer to another container with the new needed frames.

Cheers.

0
 
LVL 4

Author Comment

by:marko020397
ID: 1278615
I have tried this, but then the contents of frames change. Is it possible to look in both frames save contents (URLs) of frames and open new frameset with this contents?
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1278616
This can be done with the methods of the document object.

Would you like a way to go, or do you need full code?
0
Independent Software Vendors: 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!

 
LVL 4

Author Comment

by:marko020397
ID: 1278617
Give me just the way to do it. I will write it myself.
0
 
LVL 1

Accepted Solution

by:
superquestions earned 2000 total points
ID: 1278618
Just quit, Marko... if there is really a way to do that, then your page will probably have a lot of imcompatibility problems with browsers v3.0 or less. Well... I can just suggest you to quit with your idea.
0
 
LVL 5

Expert Comment

by:julio011597
ID: 1278619
Acually, superquestion is not wrong; any JavaScript way to accomplish the job would work great on some browser and give problems on others.

Anyway, if versions are not a concern, here is a general scheme of what i meant:

you could have a container page looking something like this:

--//--
<HTML>
  <HEAD>
    <SCRIPT LANGUAGE="JavaScript"><!--
      function updateFrames() {
        with(self.document) {
          open();
          writeln("<HTML>");
          writeln("  <FRAMESET ROWS=\"10,*\">");
          writeln("    <FRAME SRC=\"Left.htm\">");
          writeln("    <FRAME SRC=\"Right.htm\">");
          writeln("  </FRAMESET>");
          writeln("</HTML>");
          close();
        }
      }
    // --></SCRIPT>
  </HEAD>
  <FRAMESET ROWS="*,*">
    <FRAME SRC="Left.htm">
    <FRAME SRC="Right.htm">
  </FRAMESET>
</HTML>
--//--

And, in your - say - Left.htm there could be the needed link, looking like:

<A HREF="javascript:void(top.updateFrames())">Update Frame</A>

This a no-return script, i.e. you will update your frames once; but it could be easily modified to handle more complex cases.

Regards.

P.S. About points: if what i have written is of any use to you, i hope you'll award me a few points anyway... (BTW, there are ways to share points among experts too, by asking EE support)
0
 
LVL 4

Author Comment

by:marko020397
ID: 1278620
Adjusted points to 500
0
 
LVL 4

Author Comment

by:marko020397
ID: 1278621
Sorry, Julio. I though I was grading your answer and giving 500 points. I didn't notice that you were giving a comment. Now I rewarded "superquestions" for suggestion to quit, which doesn't deserve 500 points.

Now. How should I give you points? I didn't quite understand what you were thinking.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

610 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