This time I will share jQuery Plugin and tutorial about Basic Inline Modal Popup Plugin – ModalWindowJS, hope it will help you in programming stack.
ModalWindowJS is a jQuery based modal plugin for creating inline modal windows that pop up in front of other elements on the webpage.
How to use it:
1. Include the necessary JavaScript and CSS files on the webpage.
2 |
integrity = "sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" |
3 |
crossorigin = "anonymous" > |
5 |
< script src = "js/modal-window.js" ></ script > |
2. Insert your own modal content and a close button to the modal. Note that modal content will be hidden until triggered.
1 |
< div class = "modalContent example" > |
2 |
< p class = "closeBtn" >Close</ p > |
3 |
< p >Modal Content Here</ p > |
3. Create a trigger button and specify the target modal content using the ‘data-modal’ attribute:
1 |
< button class = "trigger" |
4. Initialize the modal plugin with default settings.
2 |
$(document).modalWindow(); |
5. Apply your own CSS styles to the modal window.
08 |
background : rgba( 0 , 0 , 0 , 0.5 ); |
6. To customize the modal window, override the following settings and then pass them to the ‘modalWindow()’ function.
01 |
$(document).modalWindow({ |
04 |
"openTrigger" : ".trigger" , |
05 |
"closeTrigger" : ".closeBtn" , |
06 |
"modalContent" : ".modalContent" , |
07 |
"overLay" : "overLay" , |
This awesome jQuery plugin is developed by Restoration. For more Advanced Usages, please check the demo page or visit the official website.