Basic Responsive Modal Popup Plugin with jQuery - simplePopup

Basic Responsive Modal Popup Plugin with jQuery - simplePopup
File Size: 4.49 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

An extremely simple jQuery plugin to create a responsive modal popup for showcasing your featured content.

How to use it:

1. Download and include the jQuery simplePopup plugin after jQuery library.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/jquery.simplePopup.js" type="text/javascript"></script>

2. Add your featured content into the modal popup.

<div id="demo" class="simplePopup">
    Modal content goes here
</div>

3. Style the modal popup any way you like.

.simplePopup {
  display: none;
  position: fixed;
  border: 4px solid #d870a9;
  background: #ed87bd;
  z-index: 3;
  color:#fff;
  padding: 12px;
  width: 70%;
  min-width: 70%;
}

4. Style the fullscreen overlay for the modal popup.

.simplePopupBackground {
  display: none;
  background: #000;
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

5. Style & position the close button.

.simplePopupClose {
  float: right;
  cursor: pointer;
  margin-left: 10px;
  margin-bottom: 10px;
}

5. Trigger the modal popup.

$('#demo').simplePopup();

6. Default settings.

$('#demo').simplePopup({

// always center the popup
centerPopup: true,

// callbacks
open: function() {},
closed: function() {}

});

Change log:

2015-02-20

  • Adding open and closed callbacks...

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