Solved

Document navigation

Posted on 1998-09-08
1
175 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Easy responsive table out of existing table 28 60
alert(innerHTML); 8 32
Help in good tutorials for PHP, HTML and CSS 6 43
Wordpress Hacked 1 49
This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
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…

828 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