Simple Notification Library In Vanilla JavaScript – notify.js

Category: Javascript , Notification | June 10, 2015
Author:gokulkrishh
Views Total:1,199 views
Official Page:Go to website
Last Update:June 10, 2015
License:MIT

Preview:

Simple Notification Library In Vanilla JavaScript – notify.js

Description:

notify.js is a pure vanilla JavaScript library to show custom message in notification bars that auto dismiss after a certain timeout.

Basic usage:

Load the notify.js in your html page.

<script src="notify.js"></script>

Show a success message.

notify.show('Success message', 'success', 5000);

Show an error message.

notify.show('Error message', 'error', 3000);

Style the notification bars.

.notify-container {
  width: 300px;
  height: 59px;
  position: fixed;
  top: 2px;
  right: 0;
  left: 0;
  margin: 0 auto;
  z-index: 9999;
  display: none;
}
.notify-container .notify {
  text-align: center;
  opacity: 1;
  z-index: 10;
  line-height: 3.2em;
  border-radius: 2px;
  font-size: 17px;
  color: white;
  margin-bottom: 10px;
  font-family: 'Roboto', sans-serif;
}
.notify.error { background: #de4343; }
.notify.success { background: #008000; }

You Might Be Interested In:


Leave a Reply