acModal
A very simple lightweight responsive javascript library to make custom confirm()
and alert()
acModal is very easy to use here is a basic example for an alert modal:
Install it
With npm:
Run this command in your project
npm install --save-dev ac-modal
And then:
const acModal = ;
Inline
Or you can add it with a script tag, download the file build/index.js
and then:
Make an alert modal
//on element click show an alert modaldocument;
Parameters
Name | type | required |
---|---|---|
title |
string |
false |
message |
string |
true |
buttonCallBack |
function |
false |
buttonText |
string |
false default: OK |
appendTo |
string |
false (query selector) |
Make a confirm modal
//on element click show a confirm modaldocument;
Parameters
Name | type | required |
---|---|---|
title |
string |
false |
message |
string |
true |
successCallBack |
function |
false |
successText |
string |
false default: OK |
cancelCallBack |
function |
false |
cancelText |
string |
false default: Cancel |
appendTo |
string |
false (query selector) |
For development
After you've clone the repository first run:
npm install
Then to run webpack:
npm run dev