?
Solved

Enlarge Frame

Posted on 2003-03-09
4
Medium Priority
?
298 Views
Last Modified: 2008-03-06
I have a page with three frames, a title page (top), a link page (left), and a chapter page(right). The Frameset page contains a book (the links open the various chapters), and I would like to place a button on the link page that enlarges the right frame to take up the whole broswer. (This way the reader who has a small screen doesn't have to scroll as much.)

I messed around a little using the window.frame property, but I couldn't get it to work.

WillP
0
Comment
Question by:WillP
[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
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
kollegov earned 600 total points
ID: 8100702
First of all do not NAME frame in your frameset "top"! This is reserved word :)

You can reopen content frame in the main window. (throwing out frameset)
<a href="javascript:void(0)" onClick="top.window.location.href=top.frames['right'].location.href; return false;">
Above suppose that you have frame named "right" in your frameset.





0
 

Expert Comment

by:elvin226
ID: 8100714
assuming you have this frameset:

<frameset cols=30%,*>
  <frame name=left src=left.htm>
  <frameset name=fset rows=20%,*>
    <frame name=top src=top.htm>
    <frame name=right src=right.htm>
  </frameset>
</framset>

on your left.htm include an onclick event like this on your links:

onclick=parent.fset.rows='0,*'
0
 

Author Comment

by:WillP
ID: 8101043
I wanted a button, so here's my final code.

<form>
  <p><input type="Button" onClick="top.window.location.href=top.frames['right'].location.href; return false;"value="Full Page" name="Bt1"></p>
</form>

The naming of the top frame "top" doesn't seem to matter in this case, though I'll probaby change it anyway.

Thanks,
WillP

0
 
LVL 10

Expert Comment

by:kollegov
ID: 8108184
In this particular case in context of righ frame "top" as frame name isn't in scope, so it works, but in case you
want  to do something like parent.top.location="bla.html"

parent.top may refer as top window of the parent window (reserved word)
as well as 'top' frame of parent window (frame by name)
This migh result in unexpected sideeffects....


0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

762 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