A simple dependency-free JavaScript modal
Click the following link to see the modal in action: demo.
- Include
modal.cssandmodal.js - Create a wrapper node with a class:
.modal-wrapper - Add modals containing
data-modal="somename"inside the wrapper - Open the modal by clicking any
data-modaltrigger="somename" - Or simply call the open function:
modal.open('awesome')
- Run
npm run devto run webpack and watch for changes