Skip to content

Latest commit

 

History

History
44 lines (39 loc) · 995 Bytes

README.md

File metadata and controls

44 lines (39 loc) · 995 Bytes

notify.js

a modern browser notification alert library


License

Install

<script src="notify.js" charset="utf-8"></script>

Usage

var options = {
  title: "customized title",
  dir: "rtl",
  body: "customized notification",
  timeout: 1000,
  icon: 'images/bell-icon.png',
};
var notify = new notify(options);
/* the order need use callback */
var test = notify.show();

Default Options

var defaults = {
  title: 'default title', // String
  dir: 'ltr', // String
  body: 'default notification', // String
  icon: 'images/bell-icon.png', // String, path to the icon image
  timeout: 2000 // int
};

OnClick Event

trigger something when click the notification

notify.show('onclick', function(){
  alert("Trigger Something after click the notification");
});