Lightweight Responsive jQuery Modal Popup Plugin - modality

File Size: 22.9 KB
Views Total: 13037
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Lightweight Responsive jQuery Modal Popup Plugin - modality

modality is a simple lightweight yet flexible, responsive and customizable modal plugin for jQuery that comes with 20 awesome popup transition effects powered by CSS3 animations. modality also provides a stand-alone version which enables you to quickly implement the modal popup plugin in pure JavaScript.

How to use it:

1. Load the required modality.css in your document's head section.

<link href="css/modality.css" rel="stylesheet">

2. Create a modal popup like so:

<div id="yourModalId" class="yourModalClass" style="display:none;">
  <p>Modal Content</p>
  <a href="#yourModalId">Close Modal</a> 

3. Style the modal popup however you like.

.yourModalClass {
  background-color: #e95546;
  border: 1px solid #fc6d58;
  padding: 0 1.5em 1em;
  border-radius: 5px;
  max-width: 380px;

5. Enable the modal popup using jQuery.

<script src="//"></script>
<script src="js/modality.jquery.min.js"></script> 

6. Or using pure JavaScript.

<script src="js/modality.min.js"></script>
var modal1 = Modality.init('#yourModalId', {

7. All the default options.

// automatically bind triggers to modal
bind: true, 

// user can add a class to container
class: '', 

// click anywhere off of modal to close it
clickoff: true, 

// animation style
// "scale-up", "scale-down" 
// "slide-left", "slide-right" 
// "slide-up", "slide-down" 
// "sticky-top", "sticky-bottom" 
// "horizontal-flip", "vertical-flip" 
// "spin-up", "spin-down" 
// "fall-left", "fall-right" 
// "swing-down", "swing-up" 
// "swing-left", "swing-right" 
// "front-flip", "back-flip"
effect: "", 

// set false to disable modal
enabled: true, 

// close modal with 'esc' key
keyboard: true, 

// open on page load
open: false, 

// inner wrapper
inner: 'mm-wrap',

// when modal is visible
visible: 'mm-show',

// outer-most container
outer: 'modality-modal',

// function to run when modal closes
onClose: "", 

// function to run when modal opens
onOpen: ""

Change logs:


  • Make it accessibility.


  • v2.0.


  • Update modality.jquery.js


  • 'Enable/Disable' Functionality
  • Update modality.min.js


  • Update modality.js

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