The light-weight vanilla JS modal script!
- 1.35kb minified
- Drop into any project, there are no dependencies! (Written in pure ES5 and CSS3)
- Compatible with IE9 and above (tested with IE's browser emulation)
- Works with any block level content (divs, images, videos, you name it!)
- Customizable (hardly has any default styling to begin with!)
-
Link to the script in the
<head>
of your project like so:
<script type="text/javascript" src="path/to/lite-modal.min.js"></script>
-
Add as many modals to your page as you want, simply by adding the class
lite-modal
:
<div id="sign-up-form" class="lite-modal">...</div>
-
Open the modal with a CSS selector or close the modal:
liteModal.open('#sign-up-form');
liteModal.close();