modal window inline content - Download Basic Modal Window With Inline Content - jquery.modal.js

Download Basic Modal Window With Inline Content – jquery.modal.js

Posted on

This time I will share jQuery Plugin and tutorial about Basic Modal Window With Inline Content – jquery.modal.js, hope it will help you in programming stack.

modal window inline content - Download Basic Modal Window With Inline Content - jquery.modal.js
File Size: 3.57 KB
Views Total: 523
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

An ultra simple jQuery plugin for showing a responsive, CSS3 animated modal window with inline contents from a DIV element.

How to use it:

1. Link to necessary JavaScript and CSS files.

1 <link rel="stylesheet" href="css/modal.css">
3         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
4         crossorigin="anonymous">
5 </script>
6 <script src="js/jquery.modal.js"></script>

2. Insert the modal content into a DIV container.

1 <div class="modal">
2   <div class="modal-content">
3     <span class="close">X</span>
4     <p class="modal-text"><a href="https://www.jqueryscript.net/tags.php?/Modal/">Modal</a> Content</p>
5   </div>
6 </div>

3. Create a trigger button to toggle the modal window.

1 <button class="modalbtn">open modal</button>

4. Enable the trigger button to toggle the modal window. Done.

1 $(document).ready(function(){
2      
3   $(".modalbtn").modal();
4      
5 });

5. Customize the styles of the modal window.

01 .modal{
02   display: none;
03   position: fixed;
04   z-index: 1;
05   left:0;
06   top:0;
07   width:100%;
08   height: 100%;
09   overflow: auto;
10   background-color: rgb(0,0,0);
11   background-color: rgba(0,0,0,0.8);
12 }

This awesome jQuery plugin is developed by karolinaklein. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net