alert prompt confirm alternative - Free Download Beautiful Alert/Prompt/Confirm Dialog Alternative - jQuery.alert.js

Free Download Beautiful Alert/Prompt/Confirm Dialog Alternative – jQuery.alert.js

Posted on

This time I will share jQuery Plugin and tutorial about Beautiful Alert/Prompt/Confirm Dialog Alternative – jQuery.alert.js, hope it will help you in programming stack.

alert prompt confirm alternative - Free Download Beautiful Alert/Prompt/Confirm Dialog Alternative - jQuery.alert.js
File Size: 7.16 KB
Views Total: 1108
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A JavaScript popup window alternative that helps you create beautiful and customizable popup boxes for reminding something, confirming or denying something, or prompting the user for more information.

Fully responsive and easy to implement. 

Key Features:

  • Supports HTML content.
  • Custom emphasized text.
  • Custom confirm/cancel buttons.
  • Confirm and cancel callbacks.
  • Custom input types.
  • Supports jQuery method chaining.

How to use it:

1. Add the jQuery.alert.js plugin’s files to the HTML page.

1 <link href="jquery.alert.css" rel="stylesheet" />
2 <script src="/path/to/cdn/jquery.min.js"></script>
3 <script src="jquery.alert.min.js"></script>

2. Create a custom alert dialog box.

1 $.alert('An Alert Dialog By jQueryScript',{
2   em:'Emphasized Text',
3   title:'Alert Dialog'
4 })

3. Create a custom confirm dialog box.

01 $.confirm('Are You Sure To Delete This Entry?',{
02   em:'Emphasized Text',
03   title:'Delete!',
04   callEvent:function(){
05     $.alert('Deleted!')
06   },
07   cancelEvent:function(){
08     $.alert('Canceled')
09   },
10   cancelButton:'No!'
11 })

4. Create a custom prompt dialog box.

1 $.prompt('Try To Type 1234',{
2   title:'Login Form',
3   callEvent:function(val){
4     if(val==1234) $.alert('Invalid Password');
5     else $.alert('Logged In');
6   },
7   input:'password',
8   confirmButton:'Log In'
9 })

5. The plugin also supports jQuery method chaining.

01 $('.colorChange-btn').click(function() {
02   $("#item-box").stop().animate(
03     {"margin-left":"500px"},1000
04   ).animate(
05     {"margin-left":"0"},300
06   ).delay(300).alert('Another Dialog',
07   {
08     callEvent:function(){
09       $("#item-box").stop().animate(
10         {"margin-left":"500px"},1000
11           ).animate(
12             {"margin-left":"0"},300
13           )
14       }
15   });
16 })

6. All default configurations.

01 {
02  
03   // dialog title
04   title:'Title',
05  
06   // emphasized Text
07   em:'',
08  
09   // fired when you click the confirm button
10   callEvent:null,
11  
12   // fired when you click the cancel button
13   cancelEvent:null,
14  
15   // custom button text
16   confirmButton:'Okay',
17   cancelButton:'Cancel',
18  
19   // input type
20   input:'text',
21  
22   // input value
23   value:null
24    
25 }

This awesome jQuery plugin is developed by hyunseung. For more Advanced Usages, please check the demo page or visit the official website.