View Full Version : Easy Help?

01-29-2006, 02:25 AM
I would like to add something like a HREF to an ID at the top of my webpage to a JAVASCRIPT HREF im useing on all my menu links.

The DIV with the ID looks like this:

<div id="backing">
<span id="top"><img height="545" alt="" src="jeffFist.jpg" border="0">

The JAVASCRIPT looks like this:

<script language="Javascript">
layerRef = "document.all['";
endLayerRef = "']";
styleRef = ".style";

layerArray = new Array ("frontstuff","aboutstuff","contactstuff","zinestuff","linksstuff","optionsstuff","newsstuff","extrastuff1","extrastuff2","extrastuff3","extrastuff4");

function showMenu(layerName)
eval(layerRef + layerName + endLayerRef + styleRef + ".visibility = 'visible'");


for (i=0; i<layerArray.length; i++)
if (layerName != layerArray[i])
eval(layerRef + layerArray[i] + endLayerRef + styleRef + ".visibility = 'hidden'");


This type of link works great:

<a href="#top"></a>

I would like to add the #top reference to my links useing the JAVASCRIPT itself or maybe some simple HREF format Im missing. The standard menu links look like this:

<a href="javascript:showMenu('contactstuff');">CONTACT</a>

Sorry if my question is formatted wrong or posted in the wrong place.

Thanks in advance for any help.

:confused: :eek: :confused:

01-29-2006, 01:15 PM
I'm not sure that I quite understand you, but...

<a href="#top" onclick="showMenu('contactstuff');">CONTACT</a>

01-30-2006, 05:55 AM
Yes! That helps allot, thank you.