Solved

Document navigation

Posted on 1998-09-08
1
147 Views
Last Modified: 2010-04-09
Hi there:
I have a problem with a web pages.
I have a document with two frames (left and right). The left one is a Menu and the right one is the Contents frame.

In the menu frame I would like to add a button with the next function:

When it is pusshed I would like to move the right document (can be any of the content documents) to the named anchor #information

Any help?
0
Comment
Question by:xabi
1 Comment
 
LVL 2

Accepted Solution

by:
bernfarr earned 100 total points
ID: 1837433
Assuming that you name the left document Menu and the right one Contents. Then you can add some JavaScript code behind the button that changes the href of the Contents frame.

Your button would be coded something like:
  <input type=button name=moveContents value="Get Information" onClick="MoveContent()">

and your JavaScript could be hardcoded to something like:
<SCRIPT LANGUAGE="JavaScript">
<!--
function MoveContent()
{
  parent.Contents.location.href = "http://www.contents.htm#newlocation"
}
//-->
</SCRIPT>

Note that if you simply wanted to change the #newlocation part, you can do something like:
  var cloc = parent.Contents.location; // for shorthand
  cloc.href = cloc.protocol + "//" + cloc.hostname + "/" + URL.pathname + "#newlocation";
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now