This time I will share jQuery Plugin and tutorial about Simple Plain Dialog Popup Plugin For jQuery – Alerts.js, hope it will help you in programming stack.
Alerts.js is a simple plain jQuery plugin that creates customizable popup boxes to replace the default loading, alert, dialog, confirm and prompt dialog boxes.
How to use it:
1. Just load jQuery library together with the jQuery alerts plugin’s files and we’re ready to go.
2 |
< script src = "//code.jquery.com/jquery.min.js" ></ script > |
5 |
< script src = "jquery.alerts.js" ></ script > |
6 |
< link href = "jquery.alerts.css" rel = "stylesheet" > |
2. Create a basic alert dialog.
2 |
jAlert( 'This is a custom alert box' , 'Alert Dialog' ); |
3. Create a confirmation dialog.
2 |
jConfirm( 'Can you confirm this?' , 'Confirmation Dialog' , function (r) { |
3 |
jAlert( 'Confirmed: ' + r, 'Confirmation Results' ); |
4. Create a prompt dialog.
2 |
jPrompt( 'Type something:' , 'Prefilled value' , 'Prompt Dialog' , function (r) { |
3 |
if ( r ) alert( 'You entered ' + r); |
5. Create a loading dialog to indicate the loading status.
2 |
jLoad( 'This is a custom load box' , 'Load Dialog' ); |
6. The plugin also supports html content embedded in the message.
1 |
jAlert( 'You can use HTML, such as <strong>bold</strong>, <em>italics</em>, and <u>underline</u>!' ); |
This awesome jQuery plugin is developed by caricorrejidor. For more Advanced Usages, please check the demo page or visit the official website.