GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing id.javascript.info — Create a notification

  • Tutorial
  • Browser: Document, Events, Interfaces
  • Document
  • Styles and classes
kembali ke pelajaran
Materi ini hanya tersedia dalam bahasa berikut: Čeština, Dansk, English, Español, Italiano, 日本語, 한국어, Русский, Українська, Oʻzbek, 简体中文. Tolong, bantu kami menerjemahkan ke dalam Indonesia.

Create a notification

pentingnya: 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)
});

Demo di jendela baru

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

Buka sandbox untuk tugas tersebut.

Buka solusi di kotak pasir.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.