A jQuery timed dialog UI
npm install @armino-dev/jquery-timed-dialog!CircleCI    
A jquery plugin for creating a timed modal dialog
* Under development
Install the jQuery and the jQuery timed dialog.
``bash`
npm i jquery
npm i @armino-dev/jquery-timed-dialog
Import the components into your script.
`js`
import $ from 'jquery';
import timedDialog from '@armino-dev/jquery-timed-dialog';
Import the css into your stylesheet.
`css`
import '@armino-dev/jquery-timed-dialog/dist/timed-dialog.min.css';
`html`
html
`Use it
`jsconst myCallback = () => {
console.log('The callback was executed!');
}
const options = {
type: 'confirmation',
title: 'Confirm callback execution',
body: '
Are you sure you want to execute myCallback?
Check the console
',
width: 400,
height: 280,
timeout: 10,
closeOnTimer: true,
btnConfirm: {
text: 'Execute my callback',
action: () => myCallback(),
}
};document.addEventListener("DOMContentLoaded", () => {
// add a button to dom
const button = document.createElement('button');
button.textContent = 'Show dialog';
// add a click event listener to the button
button.addEventListener("click", () => {
$().timedDialog(options);
});
// add the button to page
document.body.appendChild(button);
});
``Demo can be viewed on here
Please make sure to update the specs(tests) as appropriate.