Here I found a great jquery plugin to add fancy alert and notification popup using alertify.js, So I am going to share quick tip about how to integrate alertify.js plugin on your website and use so many alert popup option to make your website notification more dynamic and attractive.
Working with alertify.js is so easy because of it’s clean and clear api documentation. by adding small jquery codes you can create fancy popup in seconds.

First add required libraries on your page.
<link rel="stylesheet" href="PATH_TO_FILE/alertify.css" />
<link rel="stylesheet" href="PATH_TO_FILE/alertify.default.css" />
<script src="PATH_TO_FILE/alertify.min.js"></script> |
<link rel="stylesheet" href="PATH_TO_FILE/alertify.css" /> <link rel="stylesheet" href="PATH_TO_FILE/alertify.default.css" /> <script src="PATH_TO_FILE/alertify.min.js"></script>
All done now you can pick you desired alert box by adding following jquery code, some are following.
Alert Dialog
alertify.alert("Message"); |
alertify.alert("Message");
Confirm Dialog
alertify.confirm("Message", function (e) {
if (e) {
// user clicked "ok"
} else {
// user clicked "cancel"
}
}); |
alertify.confirm("Message", function (e) { if (e) { } else { } });
Prompt Dialog
alertify.prompt("Message", function (e, str) {
if (e) {
// user clicked "ok"
} else {
// user clicked "cancel"
}
}, "Default Value"); |
alertify.prompt("Message", function (e, str) { if (e) { } else { } }, "Default Value");
You can also add sidebar bar logs / notification.
alertify.log("Notification", type, wait);
alertify.success("Success notification");
alertify.error("Error notification"); |
alertify.log("Notification", type, wait); alertify.success("Success notification"); alertify.error("Error notification");
See demo and download source code
you can also explore more form official website: http://fabien-d.github.io/alertify.js/
Related