Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi,

könnt ihr mir sagen wie das mit ner Auswahlliste bei ner Homepage geht?

Also das mit <option> und drum und dran krieg ich hin, aber dass dann zum Beispiel wenn ich da ne Liste angezeigt bekomme und ich ne Zeile anklicke, dass man dann einen Link bekommt also praktisch einen Verweis auf eine andere Seite...

Könnt ihr mir bitte sagen wie das geht?

Danke im voraus!

Mit freundlichen Grüßen

Irineu:D

Du meinst also ein Menü realisieren über ein <select>

Nun ganz einfach:


<select name="menu">

  <option onclick="location.href='home.html'">HOME</option>

  <option onclick="location.href='kontakt.html'">KONTAKT</option>

</select>

Gruß,

MCT

achso...

danke =)

weil nämlich ich hab da ein projekt ich muss ein teil einer schulhomepage (meine schule die ich zurzeit besuche) und im quelltext steht das nämlich nicht...

naja danke =)

Klick mal drauf... =)

Da steht nämlich dies:

<select size="1" name="Auswahl"

onChange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)"

style="width:165px; background-color:#FFFFE0; font-size:9pt; font-family:courier new,Arial,sans-serif;"

width="165">

<option value="nothing">[ bitte auswählen! ]</option>

<option value="2004.html">2004</option>

<option value="2005.html">2005</option>

<option value="2006.html">2006</option>

</select>

und ganz oben steht noch das:

<script type="text/javascript">

<!--

function Go(x) {

if(x == "nothing") {

document.forms[0].reset();

document.forms[0].elements[0].blur();

return;

}

else if(x == "end")

parent.location.href = parent.frames[2].location;

else {

parent.frames[2].location.href = x;

document.forms[0].reset();

document.forms[0].elements[0].blur();

}

}

//-->

</script>

MfG Irineu

Muss ich bei diesem... da

Code:

<select name="menu"> <option onclick="location.href='home.html'">HOME</option> <option onclick="location.href='kontakt.html'">KONTAKT</option>

</select>

irgendwie ein Skript anlegen oder so?

Das klappt bei mir nicht...

Kannst du mir bitte ein Beispiel hier in Codeformat reinstellen, wenn sowas fertig ist?

Danke!

MfG Irineu:bimei :uli

Also das hier ist der Code von deiner Seite.


<html>
<body>

<script type="text/javascript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "end")
{
parent.location.href = parent.frames[2].location;
}
else
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>

<form action>
<select size="1" name="Auswahl" onChange="Go(this.form.Auswahl.options[this.form.Auswahl.options.selectedIndex].value)" style="width:165px; background-color:#FFFFE0; font-size:9pt; font-family:courier new,Arial,sans-serif;" width="165">
<option value="nothing">[ bitte auswählen! ]</option>
<option value="2004.html">2004</option>
<option value="2005.html">2005</option>
<option value="2006.html">2006</option>
</select>
</form>

</body>
</html>
[/code]

Und unten bei <option vlaue=""> gibst Du an welche Seite aufgerufen werden soll. Der Dateiname wird dann an die Funktion Go übergeben und der zeigt die dann an.

Frank

ja das weiß ich aber das geht irgendwie nicht...

braucht man dafür ein bestimmtes skript oder wie?

ich krieg das nie hin, dass das ein verweis ist...

also nochmal von ganz anfang an:

Wenn ich auf eine Auswahlliste klicke ne?

Dann wird diese zeile ja Blau im Hintergrund.

Wenn ich diese dann anklicke, passiert bei mir in der Datei nix, also kein Link nix etc...

versteht ihr was ich meine?

:rolleyes:

das ist der, den ich hier rein getan habe

aber mein lehrer meinte der hätte da noch ein zusatzskript...

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.