Javascript

【Javascript】jQueryは必要なし。javascript通知プラグインNotyf

January 9, 2017
Notyf

Notyfはシンプルで反応の良い、javascript通知プラグイン。jQueryは必要ありません。

Installation

<html>
  <head>
    ...
    <link rel="stylesheet" type="text/css" href="/path/to/notyf.min.css">
  </head>
  <body>
    ...
    <script src="/path/to/notyf.min.js" type="text/javascript"></script>
  </body>
</html>

Usage

//Create an instance of Notyf
var notyf = new Notyf();

//Display an alert notification
notyf.alert('You must fill out the form before moving forward');

//Display a success notification
notyf.confirm('Your changes have been successfully saved!');

Options

Param Default
delay 2000
alertIcon Custom Notyf icon
confirmIcon Custom Notyf icon

example

var notyf = new Notyf({
  delay:1000,
  alertIcon: 'fa fa-exclamation-circle',
  confirmIcon: 'fa fa-check-circle'  
})

MIT
Demo/Download