Pure JS function which create a custom modal popups with any kind of message or close button - supports callback functions.
- require babel
- require GSAP
Usage:
- id - set ID name of modal popup (default: modPop)
- alert - set default message box
- width - set popup max width (default: 700px)
- background - set background (default: transparent)
- zIndex - set z-index (default: 900)
- border - set border radius (default: 10px)
- shadow - set popup box-shadow (default: 4px 6px 20px rgba(0,0,0,.3))
- btnMsg - set default close button text
- btnClass - set default button class name
- cb - name of the callback function which runs immediately after modal close
[1] import module
import {modPop} from "./tpl/modPop";
window.modPop = function(...args){
new modPop(...args);
};
[2] global call
modPop({
msg: 'Default alert message.',
btnMsg: 'Close'
btnClass: 'example-class1 example-class2'
});
..as bright as the sun, as straight as wire =)