Multilinks | JavaScriptSource

Multilinks

JavaScriptSource Staff Nov 15, 2006

General

Sometimes you want a single hyperlink to lead to several pages and present a dynamic menu when clicked. This is usually done through an intermediary page. This script will provide a dynamic menu by creating an absolutely-positioned DIV tag on the fly, which will contain the list of links.


Click for other JavaScript sources

Notes

The handler should call the show_hide_multilink function with five parameters:

  • The first parameter should always be this.
  • The second and the third are width and height of the box respectively.
  • The fourth is a style class name, which will be applied to all the elements of created DIV (The DIV itself, LI and A tags). Unless the BODY of your page has background set, specify background in this style class.
  • The last one is a ;-separated list of URLs and anchor texts that should apppear.

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: multiLinks.js


CSS

Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(9 comments)

You need to use the onmouseout event handler to cancel the operation.

Lee Oct 3, 2007

You would need to format that in the links window.

Lee Oct 3, 2007

Sorry, another question.[br /]I changed the window to open onMouseover instead of onClick, but it seems to get stuck open. How do I make sure it closes when you mouse out of the area?[br /][br /]Thanks again!!

Kerri Sep 7, 2007

Is there a way to have the links open in a new window?[br /][br /]thank you!!

Kerri Sep 7, 2007

--- Quote ---[p]From: Oreb[br /]11/17/2006 13:18:42[br /]Using Firefox v2 under Windows 2000, I can't get the choice box to close. In fact this comment may not make sense because part of it is being typed blind behind the list window. :) [p]--- Unquote ---[p]Same problem with IE6 too. Must be due to coding, not the browser. Any fixes??

Celal Dec 4, 2006