clean simple modal - Free Download Pretty Clean Popup Window Plugin - jQuery Simple Modal

Free Download Pretty Clean Popup Window Plugin – jQuery Simple Modal

Posted on

This time I will share jQuery Plugin and tutorial about Pretty Clean Popup Window Plugin – jQuery Simple Modal, hope it will help you in programming stack.

clean simple modal - Free Download Pretty Clean Popup Window Plugin - jQuery Simple Modal
File Size: 29.5 KB
Views Total: 974
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A really simple (~2kb), pretty clean, fully responsive modal jQuery plugin that features HTML content, prevent body scroll, callback function, and much more.

How to use it:

1. Insert the jQuery Simple Modal plugin’s files into the HTML document.

1 <link href="/path/to/dist/css/jquery.simple-modal.css" rel="stylesheet" />
2 <script src="/path/to/cdn/jquery.min.js"></script>
3 <script src="/path/to/dist/js/jquery.simple-modal.js"></script>

2. Create a basic modal popup. Don’t forget to replace the default modal title & body as follows:

01 $().simpleModal({
02  
03   // unique name
04   name: 'jqueryscript',
05  
06   // modal title
07   title: 'Modal Title Here',
08  
09   // modal content
10   content: '<p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Placeat ullam mollitia aspernatur.</p><button class="btn btn-danger">Lorem ipsum</button>'
11  
12 })

3. Set the modal size: ‘small’, ‘middle’, ‘large’, or interger. Defaults to ‘small’.

1 $().simpleModal({
2  
3   size: 'large'
4  
5 })

4. Determine whether or not to disable the body scroll when the modal is opened. Default: true.

1 $().simpleModal({
2  
3   freeze: false
4  
5 })

5. Execute a callback function after the modal is opened. This example shows how to open another modal from the current modal using the callback parameter:

01 $().simpleModal({
02  
03   content: '<p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Placeat ullam mollitia aspernatur.</p><button class="my-button">Click Me</button>',
04  
05   callback: function() {
06     $('.my-button').click(function() {
07       $().simpleModal({
08         name: 'example4',
09         title: 'Example',
10         size: 'large',
11         content: '<p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Placeat ullam mollitia aspernatur.</p>'
12       })
13     });
14   }
15  
16 })

Changelog:

2020-04-19

  • fix custom width (use max-width)

2020-02-10

  • Allows custom width

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