Web Analytics Made Easy -
StatCounter Drop Down Menus Code - CodingForum

Announcement

Collapse
No announcement yet.

Drop Down Menus Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drop Down Menus Code

    Hi,
    Can someone tell me where I can get the source code for drop drop menus...I need to have 7 menus each with 3 to 4 options..
    thanks,
    Reddy

  • #2
    i think there are many free script for that, try dynamicdrive.com section Menus and navigation systems

    Comment


    • #3
      Here's the script!!!

      Here's the script:

      <!--BEGIN MAIN PULL-DOWN NAVIGATION SCRIPT - Insert in the head section-->
      <script language="javascript" type="text/javascript">
      // (c) 2002 Premshree Pillai
      // http://javascript.qik.cjb.net
      // http://www.qiksearch.com
      // [email protected]

      function goNav(formName,selectName,targetVal)
      {
      var formComp=eval('document.' + formName + '.' + selectName + '.options[document.' + formName + '.' + selectName + '.selectedIndex].value');
      if ((formComp != "none" && ""))
      {
      if(targetVal!="_top")
      {
      eval(targetVal + '.location = formComp');
      }
      else
      {
      window.open(formComp);
      }
      }
      }
      </script>
      <!--END MAIN PULL-DOWN NAVIGATION SCRIPT-->

      <!--Begin Navigation Menu 1-->
      <script language="JavaScript" type="text/javascript">
      document.write('<form name="form1"><select name="select1">');
      document.write('<option value=none>Menu 1</option>');
      document.write('<option value=none>--------------------</option>');
      document.write('<option value="http://www.qiksearch.com">Qiksearch.com</option>');
      document.write('<option value="http://www.qiksearch.com/javascripts.htm">FREE JavaScripts</option>');
      document.write('</select>');
      document.write('<input type="button" value="Go" onclick="goNav(\'form1\',\'select1\',\'frame1\')">');
      document.write('</form>');
      </script>
      <!--End Navigation Menu 1-->

      <!--Begin Navigation Menu 2-->
      <script language="JavaScript" type="text/javascript">
      document.write('<form name="form2"><select name="select2">');
      document.write('<option value=none>Menu 2</option>');
      document.write('<option value=none>--------------------</option>');
      document.write('<option value="http://www.qiksearch.com/intellisearch.htm">Intellisearch Bar 2.0</option>');
      document.write('<option value="http://www.qiksearch.com/premshree/index.htm">Premshree\'s Site</option>');
      document.write('</select>');
      document.write('<input type="button" value="Go" onclick="goNav(\'form2\',\'select2\',\'_top\')">');
      document.write('</form>');
      </script>
      <!--End Navigation Menu 2-->

      When you want to create another menu, use the same code as the one for the above menus....you will have to make changes to the name of the form and the name of the select box. If you observe in the code, the name of first form is 'form1' and select box is 'select1', name of second form is 'form2' and select box is 'select2'. Also observe the onClick event for the "Go" button

      onclick="goNav(\'form1\',\'select1\',\'frame1\')"

      The function goNav is called with 3 arguments. The first one 'form1' is the name of the form. The second 'select1' is the name of the select box. The third argument 'frame' is the name of the target. To open in same window use 'this'. For new window '_top' or for any frames that you have defined use the name of the frame. So for every new menu the arguments for the function goNav() will change.
      If you do not want a particular 'option' in the select menu to be linked simple write it as <option value=none>OptionValueName</option>

      Hope you get it!
      Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal

      Comment

      Working...
      X