Javascript menu

Discussion in 'JavaScript' started by dean5000v, Aug 5, 2008.

  1. #1
    hey well ive used some java script which will basically print the menu name u are hovering over below the navigation here is the website that i have done it over if u hover over the navigation drop downs u wil see what i mean.

    http://www.weblayoutsrus.com/clere/?pg=handbag_charm

    here is the javascript i used for this.

    <script language="JavaScript" src="overlib_mini.js"></script>
    <SCRIPT>
        StartMenuAt='products'; // The english version of the menu you want to start with. Use only LOWERCASE.
        ourText= new Array(2);
        
        function changeContent(what,text) {
          if (browse=='ie') eval(what).innerHTML = text;
          if (browse=='net') {
            with (document[what].document) {
              open();
              write(text);
              close();
            }
          }
          if (browse=='dom') document.getElementById(what).innerHTML = text;
        }
        
        function cleartext() {
          changeContent('themaintext','');
        }
        
        function settext(wich) {
          changeContent('themaintext',ourText[wich]);
        }
        
        ourText[0]=' ';
    	ourText[1]=' ';
    	ourText[2]='Pen Sets ';
    	ourText[3]='Stationery Sets ';
    	ourText[4]='Slimeline Pens ';
    	ourText[5]='Pens ';
    	ourText[6]='Crystal Collection ';
    	ourText[7]='Multi Pen Packs ';
    	ourText[8]='Boxed Pens ';
    	ourText[9]='Leather Pens ';
    </script>
    Code (markup):
    and then i simply added in this html for it to work into my main body of the page.

    <div align="justify" class="straplines" name="themaintext" id="themaintext">

    this works great when you hover over a tab, but if you dont then it doesnt tell u know the current page you are on, is there a way i can add in some javascript into the html which is going to be the default text unless they hover over the navigation.
     
    dean5000v, Aug 5, 2008 IP
  2. Syfonic

    Syfonic Peon

    Messages:
    452
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Checkout a site such as HTML Goodies. I have seen a code that does similar to that there I think.
     
    Syfonic, Aug 5, 2008 IP