Andy: Dropdown

Hi,

in meinem Dropdown-Menü hab ich viele Einträge. Ab dem elften Eintrga wird mir eine vertikale Scrollbar angezeigt.
Wie kann ich die Größe ändern, das dies nicht mehr geschieht?

Mfg

Andreas

  1. hallo Andreas,

    in meinem Dropdown-Menü hab ich viele Einträge. Ab dem elften Eintrga wird mir eine vertikale Scrollbar angezeigt.

    Erst ab dem elften? Normalerweise sind es, glaube ich, sieben.

    Wie kann ich die Größe ändern, das dies nicht mehr geschieht?

    Interessante Frage, die vor längerer Zeit sogar Stefan Muenz selber mal gestellt hatte. Es gibt _eine_ Lösung dafür im Archiv, ich finde das aber jetzt auch nicht. Also setze ich dir ausnahmsweise mal eine ganze Seite her, die in dieser Form aber nur in einem Frameset funktioniert (ich glaube, das ist exakt das Script, das auch im Archiv irgendwo herumschwirrt). Wichtig ist der Scriptaufruf im <body>, mit dem du festlegen kannst, wieviele Zeilen aufgeklappt werden sollen:

    <HTML>
    <head>
    <script language="JavaScript">
    function Go(x)
    {
     if(x == "nothing")
     {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
     }
     else if(x == "end") top.location.href = parent.frames[1].location;
     else
      {
       parent.frames[1].location.href = x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
      }
    }
    </script>
    </head>

    <body>

    <form name="test">

    <select size=1 name="Auswahl"
    onChange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)">

    <option value="nothing">Wählen Sie bitte eine Kategorie:
    <option value="report.htm">report
    <option value="people.htm">people
    <option value="architecture.htm">architecture
    <option value="specials.htm">special's
    <option value="experiments - art.htm">experiments / art
    <option value="landscape.htm">landscape
    <option value="art-events.htm">art-events
    <option value="nudes.htm">nudes
    <option value="streetlife.htm">streetlife
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    <option value="stills.htm">stills
    </select>

    </form>

    <script language="JavaScript">
    Auswahl1=document.test.Auswahl
    Auswahl1.size=30;
    Auswahl1.columns=30;
    </script>

    Grüße aus Berlin

    Christoph S.