jQuery Multi-Purpose Popup Modal Plugin - popModal

File Size: 26.1 KB
Views Total: 45571
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
jQuery Multi-Purpose Popup Modal Plugin - popModal

popModal is a powerful and versatile jQuery modal plugin which allows you to create popup windows for multiple purposes like hint modal, notify modal, dialog modal and much more.

How to use it:

1. Load the required jQuery popModal's stylesheet in the head section of the document.

<link type="text/css" rel="stylesheet" href="popModal.css">

2. Load the jQuery library and jQuery popModal's javascript at the end of the document so the pages load faster.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="popModal.js"></script>

3. Create the content for the modal window.

<div id="content" style="display:none">

Your content goes here

<div class="popModal_footer">
<button type="button" data-popModalBut="ok">ok</button>
<button type="button" data-popModalBut="cancel">cancel</button>

4. Create a button to open a modal window.

<button id="demo">Click me</button>

5. Call the plugin.

html : $('#content').html()

6. Default parameters. Check out the demo page for more usages & examples.

  // Static html, dinamic html, string, function (object, string, function). 
  // Use function if you want load content via ajax.
  html: '',

  // Popup position (string).
  // 'bottomCenter', 'bottomRight', 'leftTop', 'leftCenter', 'rightTop', 'rightCenter'
  placement: bl,

  // show/hide close button on popup (boolean).
  showCloseBut: true,

  // close popup when click on any place (boolean).
  onDocumentClickClose : true,

  // prevent close popup when click on specified elements (string).
  onDocumentClickClosePrevent : '',

  // overflow content (boolean).
  overflowContent : false,

  // create popup relative element (boolean).
  inline : true,

  // use popup for show as dropdown menu
  asMenu : false,

  // size of popup
  size : '',

  // show text, before loading content (string).
  beforeLoadingContent : 'Please, waiting...',

  // code execution by clicking on OK button, contained in popup (function).
  onOkBut: function() {return true;},

  // code execution by clicking on Cancel button, contained in popup (function).
  onCancelBut: function() {},

  // code execution before popup shows (function).
  onLoad: function() {},

  // code execution after popup closed (function).
  onClose: function() {}

7. Hide the popup manually.


8. Events.

var myPopup = $('#demo').popModal();

myPopup.on('load', function() {});

myPopup.on('close', function() {});

myPopup.on('okbut', function() {});

myPopup.on('cancelbut', function() {});

Change logs:


  • fixed for ie11



  • JS & CSS update


  • JS & CSS update


  • update 

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