Results 1 to 3 of 3

Thread: Easy Help?

  1. #1
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Easy Help?

    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">
    </span>
    </div>
    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'");

    layerName

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

    -->
    </script>
    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.


  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I'm not sure that I quite understand you, but...
    Code:
    <a href="#top" onclick="showMenu('contactstuff');">CONTACT</a>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes! That helps allot, thank you.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •