<button id="error" style="display: block; margin-bottom: 1em;">Click me to cause an error message</button> <button id="info" style="display: block; margin-bottom: 1em;">Click me to cause an info message</button> <button id="success" style="display: block; margin-bottom: 1em;">Click me to cause a success message</button>
$("#error").on("click", function() { noty({text: "Dude. Stop it.", layout: 'topLeft', timeout: 5000, type: 'error', killer: true}); }); $("#info").on("click", function() { noty({text: "A quick hello.", layout: 'topRight', timeout: 500, type: 'information'}); }); $("#success").on("click", function() { noty({text: "Can you click it?", layout: 'center', timeout: false, type: 'success', closeWith: ['click']}); });