min-modal-js
v1.0.4
Published
ModalJS is a class to help you quickly create modals.
Downloads
7
Readme
Min Modal JS
npm i min-modal-js --save-dev
<link rel="stylesheet" href="min-modal-js.min.css">
<script src="min-modal-js.min.js"></script>
<div class="modal-btn">
this is button can open modal
</div>
<div class="modal-inner">
<div class="modal__closeBtn">this is button can close modal</div>
content modal
</div>
const newModal = new minModalJS('.modal-inner', {
buttonsActive: '.modal-btnOpen',
buttonsDisActive: '.modal-btnClose',
keyOpen: 'Your key code', // Or false
modalOutsideClick: false // if true, modal closed when you click outside content modal
});
const newModal = new minModalJS('.modal-inner',
newModal.modalOpen() // When you will open page. This modal window will open
newModal.modalClose() // When you will open page. This modal window will close
newModal.modalDestroy() // When you will open page. This modal window with inner content will removed