Html notifications pure javascript.
- Add html Code
- Init Notifications
- Notification Types
- Notifications Methods
- Notification history Window
- Example Html Code
<script src="assets/notifications.min.js" type="text/javascript"></script>
Find example in notifications.html
Notification(Time shows message in seconds)
Example :
Notify = new Notification()
Use default time shows message (8 seconds)
Notify = new Notification(4)
Set default time shows message (4 seconds)
Notify = new Notification(0)
Disabble time (allways on screen)
Note: To close any notification, just click on the notification
- Warning
- Info
- Alert
- OK
Show/Hide Notifications. Default is true
Example :
Notify.stateNotifications(true)
Show Notifications
Notify.stateNotifications(false)
Dont Show Notifications
Get Notifications state, return true or false
Hide (Temporary) Notifications
Get Temporary Notifications state, return true or false
Cancel setTemporaryOff
Add/Show Notification (If the id already exists an update will be made)
Example :
Notify.addNotification("01", "Alert", "Notification 01");
Use default time shows message
Notify.addNotification("01", "Alert", "Notification 01", 10);
Sets 10 seconds for the time it shows message for this notification
Notify.addNotification("01", "Alert", "Notification 01", 0);
Shows the notification until the delNotification or delallNotifications method is called or the notification is clicked
Update/Change Notification
Set time shows notification message
Example :
Notify.setNotificationTimeOut("01", 4);
Set 4 seconds time shows message for notification with id "01"
Delete/Remove Notification from screen
Example :
Notify.delNotification("01")
Delete all notification
Show notification history
Close notification history
Delete all notification history