Basic Alert/Confirm/Prompt Dialog Plugin With jQuery - qonvex_alert

File Size: 3.71 KB
Views Total: 1152
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Basic Alert/Confirm/Prompt Dialog Plugin With jQuery - qonvex_alert

qonvex_alert is a lightweight jQuery dialog plugin which makes it easier to create pretty clean alert, confirmation, and prompt dialog boxes. Can be used as an alternative to the native JavaScript popup boxes.

How to use it:

1. To get started, include jQuery JavaScript library and the qonvex_alert plugin's files on the html page.

<script src="https://code.jquery.com/jquery-3.3.1.min.js" 
        integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" 
        crossorigin="anonymous">
</script>
<script src="qonvex_alert.js"></script>

2. Create a custom alert dialog. Available parameters:

  • message: dialog message
  • title: dialog title
// dialog.alert(message, title);
dialog.alert('Alert Message', 'Alert Title');

3. Create a custom confirm dialog. Available parameters:

  • message: dialog message
  • title: dialog title
  • callback: triggered after you click the Yes button
  • btnCaption: text for Yes and No buttons
const myCallback = function() {
  dialog.alert('You Just Clicked Yes', 'Callback');
}

// dialog.confirm(message, callback, title, btnCaption); 
dialog.confirm('Are You Sure?', myCallback, 'Delete The Item', { ok: 'Okey', cancel: 'Cancel'}); 

4. Create a custom prompt dialog. Available parameters:

  • message: dialog message
  • title: dialog title
  • callback: triggered after you click the Yes button
const myCallback = function() {
  dialog.alert('You Just Clicked Yes', 'Callback');
}

// dialog.prompt(message, callback, title); 
dialog.prompt('Your Username',  myCallback, 'Subscription');

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