Advanced Search

Results 1 to 5 of 5

Thread: How to make first item in the menu clickable

  1. #1
    Join Date
    Sep 2008
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to make first item in the menu clickable

    I want to first item in the menu clickable (go to the page I specified) how to do this?


    http://6g6.eu/sih0-111snap000708.jpg

    Head section:
    Code:
    <script language="javascript" type="text/javascript">
    <!--
    function menu_goto( menuform )
    {
        var baseurl = "http://www.aymavisi.org/" ;
        selecteditem = menuform.newurl.selectedIndex ;
        newurl = menuform.newurl.options[ selecteditem ].value ;
        if (newurl.length != 0) {
          location.href = baseurl + newurl ;
        }
    }
    //-->
    </script>

    Body part:

    Code:
    <select name="newurl" onchange="menu_goto(this.form)" style=" color: #FFFFFF; text-decoration: none; font-family: Tahoma; font-weight: bold; text-align: center; background-color: #444577;padding: 2px; font-size:9pt; width:130" size="1" id="menu">
    <option value=""></option>
    <option value="index.html">Ana Sayfa</option>
    <option value="8 Felsefe.htm">Felsefe</option>
    <option value="9 Siir.htm">Şiir</option>
    <option value="2 Makale.htm">Makale</option>
    <option value="4 Hikaye.htm">Hikaye</option>
    <option value="3 Psikoloji.htm">Psikoloji</option>
    <option value="5 Guncel.htm">Güncel</option>
    <option value="6 Kitap.htm">Kitap</option>
    <option value="7 Muzik.htm">Müzik</option>
    <option value="999 Benden.htm">Benden</option>
    <option value="99 Egzersiz.htm">Egzersiz</option>
    <option value="hata raporu.html">Hataları bildirin</option>
    <option value="1 yeniler.html">Yeni eklenenler</option>
    <option value="../ziyareci defteri/index.php?&amp;mots_search=&amp;lang=english&amp;skin">
    Ziyaretçi defteri</option>
    </select>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,636
    Thanks
    42
    Thanked 2,896 Times in 2,868 Posts
    Blog Entries
    12

    Default

    As long as it's not the default selected, it should be clickable.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2008
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    27,636
    Thanks
    42
    Thanked 2,896 Times in 2,868 Posts
    Blog Entries
    12

    Default

    That's a different select than from your post, and that page is not on the list.

    The select in your post has an empty option at the beginning which would make all of the others clickable.

    Even without that, if this page were on the list, you could hard code its option as selected, which would make all of the other pages on the list clickable. Like if this page were the "9 Siir.htm" page, you could select its option like so:

    Code:
    <select name="newurl" onchange="menu_goto(this.form)" style=" color: #FFFFFF; text-decoration: none; font-family: Tahoma; font-weight: bold; text-align: center; background-color: #444577;padding: 2px; font-size:9pt; width:130" size="1" id="menu">
      <option value="index.html">Ana Sayfa</option>
      <option value="8 Felsefe.htm">Felsefe</option>
      <option value="9 Siir.htm" selected>Şiir</option>
      <option value="2 Makale.htm">Makale</option>
      <option value="4 Hikaye.htm">Hikaye</option>
      <option value="3 Psikoloji.htm">Psikoloji</option>
      <option value="5 Guncel.htm">Güncel</option>
      <option value="6 Kitap.htm">Kitap</option>
      <option value="7 Muzik.htm">Müzik</option>
      <option value="999 Benden.htm">Benden</option>
      <option value="99 Egzersiz.htm">Egzersiz</option>
      <option value="hata raporu.html">Hataları bildirin</option>
      <option value="1 yeniler.html">Yeni eklenenler</option>
      <option value="../ziyareci defteri/index.php?&mots_search=&lang=english&skin">Ziyaretçi defteri</option>
    </select>
    It would be highlighted and selected by default, all other pages would be clickable.

    Or, You could just put this script as the last thing before the closing </body> tag:

    Code:
    <script type="text/javascript">
    document.getElementsByName('newurl')[0].options.selectedIndex = -1;
    </script>
    Last edited by jscheuer1; 05-30-2013 at 06:17 AM. Reason: found another solution
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    nizamo (05-30-2013)

  6. #5
    Join Date
    Sep 2008
    Posts
    18
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Second method just fine for me, thank you Mr. John, once again you helped me lot!

Similar Threads

  1. Ultimate fadeinslideshow - Make Text Clickable
    By remoteone in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 10-30-2012, 12:56 PM
  2. RSS displaybox: make the links in the text clickable
    By flapane in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 10-25-2010, 07:30 AM
  3. make the (other) mouseover display image id a clickable link
    By artisartsy in forum Looking for such a script or service
    Replies: 3
    Last Post: 08-22-2010, 04:45 PM
  4. Switch menu 2.2 top item and sub item confusion
    By gazanson in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 09-20-2007, 06:08 PM
  5. Can I make an entire <td> field 'clickable'?
    By DowntownEER in forum JavaScript
    Replies: 6
    Last Post: 07-23-2006, 04:04 PM

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
  •