jQuery Plugin To Create Dynamic Custom Bootstrap Modals - Download jQuery Plugin To Create Dynamic Custom Bootstrap Modals

Download jQuery Plugin To Create Dynamic Custom Bootstrap Modals

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Create Dynamic Custom Bootstrap Modals, hope it will help you in programming stack.

File Size: 6.07 KB
Views Total: 1619
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A Bootstrap Modal Maker plugin with jQuery that makes it easier to create dynamic Bootstrap modals with custom titles, content, buttons and callbacks on your webpage.

How to use it:

1. Make sure you’ve loaded jQuery library, Bootstrap’ stylesheet and Bootstrap modal component in the html document.

1 <link rel="stylesheet" href="/path/to/bootstrap.min.css">
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/bootstrap.min.js"></script>

2. Load the minified version of the Bootstrap Modal Maker plugin after jQuery.

1 <script src="jquery.bootstrap-modal-maker.min.js"></script>

3. Display a default Bootstrap modal with custom title & content on page load.

1 $.modalMaker({
2   'title': 'Hello World!',
3   'content': 'Modal Content Goes Here!'
4 });

4. Display a default Bootstrap modal (confirm dialog) with custom title & content on page load.

1 $.modalMaker({
2   'title': 'Hello World!',
3   'content': 'Modal Content Goes Here!'
4 });

5. Create your own actions buttons with callbacks inside the modal.

01 $.modalMaker({
02   buttons: [
03     {
04       "text": "OK",
05       "class": "btn-default",
06       "callback": function () {
07         alert("OK!");
08       },
09       "dismiss": true
10     },
11     {
12       "text": "Cancel",
13       "class": "btn-danger",
14       "callback": function () {
15         alert("Cancelled!");
16       },
17       "dismiss": true
18     }
19   ]
20 });

6. Assign an unique ID to the modal. Good for multiple modal instances on one page.

1 $.modalMaker({
2   'title': 'Hello World!',
3   'content': 'Inner html'
4   'id': ""
5 });

7. The plugin also supports innerHTML.

1 $.modalMaker({
2   'title': 'Hello World!',
3   'content': '<p>Inner html</p>'
4 });

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

source : jqueryscript.net