PNotify

by Faisal Pathan

HTML

<script src="//cdn.jsdelivr.net/pnotify/2.0.0/pnotify.all.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/pnotify/2.0.0/pnotify.all.min.css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<button onclick = 'delete_category()'>Delete user</button>

JavaScript

function delete_category() {
    PNotify.prototype.options.styling = "bootstrap3";
     (new PNotify({
        title: 'Confirmation',
        text: 'This will delete the category?',
        icon: 'glyphicon glyphicon-question-sign',
        hide: false,
        confirm: {
            confirm: true
        },
        buttons: {
            closer: true,
            sticker: false
        },
        history: {
            history: false
        }
    })).get().on('pnotify.confirm', function() {
        alert('Ok, cool.');
    }).on('pnotify.cancel', function() {
        alert('Oh ok. Chicken, I see.');
    });
  }