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.

Navigation

Empfohlene Antworten

Veröffentlicht

Hallo zusammen!

Ich möchte eine Textbasierte Navigation erstellen, die folgende Struktur hat:

» LINK1

» LINK2

» LINK3

» LINK4

» LINK5
wenn ich nun auf LINK1 klicke soll sich eine Art Untermenü öffnen:
» LINK1

  » U_LINK1

  » U_LINK2

  » U_LINK3

» LINK2

» LINK3

» LINK4

» LINK5

Kann mir jemand Tips geben wie ich es realisieren kann? Danke im voraus!

Meinst Du so?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

  <head>

    <title>Menü</title>

		<style type="text/css" media="screen">

    ul ul {

      display: none;

    }

    </style>

    <script type="text/javascript">

    function openSub(id) {

      var theSub = document.getElementById('sub' + id);

      theSub.style.display = 'block';

    }

    </script>

  </head>

  <body>

    <ul>

      <li>

        <a href="#" onclick="openSub(1);">LINK1</a>

        <ul id="sub1">

          <li><a href="#">U_LINK1</a></li>

          <li><a href="#">U_LINK2</a></li>

          <li><a href="#">U_LINK3</a></li>

        </ul>

      </li>

      <li><a href="#">LINK2</a></li>

      <li><a href="#">LINK3</a></li>

      <li><a href="#">LINK4</a></li>

      <li><a href="#">LINK5</a></li>

    </ul>

  </body>

</html>

Gruß, Tobias


function openSub(id) {

      var theSub = document.getElementById('sub' + id);

      if (theSub.style.display == 'block') theSub.style.display = 'none';

      else theSub.style.display = 'block';

 }

  • Autor

Wenn ich nun auf einen Link klicke und eine neue Seite geladen wird, werden ja die Untermenüs wieder "eingefahren". Wie funktioniert es das die Untermenüs auch auf der Neugeladenen Seite noch ausgefahren bleiben?

Ja, nun, wie wär's denn wenn Du Dir zur Abwechslung erstmal selber Gedanken machst und dann anhand von konkreten Codebeispielen Fragen stellst? Nur als Tipp: Man könnte die Navigation z. B. in einem PHP-Array abbilden und die Navigation dann immer passend zusammenbauen.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.