Handy Info/Confirm Modal Dialog Plugin - Timed Dialog

Handy Info/Confirm Modal Dialog Plugin - Timed Dialog
File Size: 18.6 KB
Views Total: 220
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The Timed Dialog helps developers create customizable info/alert/confirm modal dialogs to replace the native popup boxes.

Key Features:

  • Easy to style using your own CSS.
  • Auto dismisses after a timeout, with or without a countdown timer.
  • Supports any HTML content embedded in the dialog.
  • Allows you to append the dialog to any container element, not only the whole body.

How to use it:

1. Import the jQuery Timed Dialog plugin's files into the HTML file.

<link href="/path/to/css/timed-dialog.css" rel="stylesheet" />
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/timed-dialog.min.js"></script>

2. Create a basic 'Info' dialog and override the default dialog title & body.

$().timedDialog({
  body: '<b>HTML Content</b> is supported as well.',
  title: 'Dialog Title'
});

3. Create a confirmation dialog and execute a function when the user clicks the 'Confirm' button.

$().timedDialog({
  type: 'confirmation',
  body: 'Are You Sure?',
  title: 'Confirm Your Action',
  btnConfirm: {
    text: 'Confirm',
    action: () => {
    alert('done')
  }}
});

4. Customize the width/height of the dialog.

$().timedDialog({
  width: 400,
  height: 300
});

5. Determine whether to auto-close the dialog after a timeout, with an animated countdown timer on the 'Dismiss' button.

$().timedDialog({
  closeOnTimer: true,
  timeout: 20,
  timeoutAnimation: true
});

6. All default configuration options.

$().timedDialog({
  type: 'info',
  title: 'Info',
  body: 'This is the default body text. You might replace this with your own.',
  width: 320,
  height: 240,
  appendTo: 'body',
  closeOnEscape: true,
  closeOnTimer: false,
  timeout: 10, //ten seconds default timeout
  timeoutAnimation: true,
  isModal: true,
  btnDismiss: {
    text: "Dismiss",
    class: '',
  },
  btnConfirm: {
    text: "Confirm",
    action: () => {
        return
    },
    class: '',
  }
});

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