• ARعربي
  • ENEnglish
  • ESEspañol
  • FAفارسی
  • FRFrançais
  • IDIndonesia
  • ITItaliano
  • JA日本語
  • KO한국어
  • RUРусский
  • TRTürkçe
  • UKУкраїнська
  • ZH简体中文

Nous souhaitons rendre ce projet open source disponible pour les gens du monde entier.

Aidez-nous à traduire le contenu de ce tutoriel dans votre langue!

    AcheterEPUB/PDF
    Carte du tutoriel
    Partager
    • Tutoriel
    • Navigateur : Document, Évènements, Interfaces
    • Document
    • Styles et classes
    retour au cours
    Ce contenu n'est disponible que dans les langues suivantes :English, Español, Italiano, 日本語, 한국어, Русский, Українська, 简体中文. Merci de

    Create a notification

    importance: 5

    Write a function showNotification(options) that creates a notification: <div class="notification"> with the given content. The notification should automatically disappear after 1.5 seconds.

    The options are:

    // shows an element with the text "Hello" near the right-top of the window
    showNotification({
      top: 10, // 10px from the top of the window (by default 0px)
      right: 10, // 10px from the right edge of the window (by default 0px)
      html: "Hello!", // the HTML of notification
      className: "welcome" // an additional class for the div (optional)
    });

    Démo dans une nouvelle fenêtre

    Use CSS positioning to show the element at given top/right coordinates. The source document has the necessary styles.

    Open a sandbox for the task.

    Ouvrez la solution dans une sandbox.

    • © 2007—2025  Ilya Kantor
    • à propos du projet
    • nous contacter