Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Enlarge Frame

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
WillP
Asked:
WillP
  • 2
1 Solution
 
kollegovCommented:
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
 
elvin226Commented:
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
 
WillPAuthor Commented:
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
 
kollegovCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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