Solved

Document navigation

Posted on 1998-09-08
1
186 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
[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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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 …

726 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