up
This commit is contained in:
parent
4272b7bb13
commit
508969c13f
168 changed files with 340 additions and 10 deletions
|
@ -0,0 +1,24 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# Create a notification
|
||||
|
||||
Write a function `showNotification(options)` that a notification: `<div class="notification">` with the given content. The notification should automatically disappear after 1.5 seconds.
|
||||
|
||||
The options are:
|
||||
|
||||
```js
|
||||
// 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 src="solution"]
|
||||
|
||||
|
||||
Use CSS positioning to show the element at given top/right coordinates. The source document has the necessary styles.
|
Loading…
Add table
Add a link
Reference in a new issue