Download
User Rating: 0/5 ( 0 votes)
Pop Easy is a light weight jQuery plugin that is a must have for any developer to easily create modal windows. Put focus on important elements by applying a mask to your page and opening a customizable pop up modal window.http://www.jquerybyexample.net/2014/06/top-10-newest-jquery-popup-window-plugins.html
Source: thomasgrauer.com
1. INCLUDE JS FILES
<script type='text/javascript' src='js/jquery.modal.js'></script>
<script type='text/javascript' src='js/site.js'></script>
2. HTML
<a class="modalLink" href="#">Click Me
<div class="overlay"></div>
<div class="modal">
<a href="#" class="closeBtn">Close Me</a>
<!-- content here -->
</div>
3. CSS
.overlay{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 1000;
display: none;
}
.modal{
display: none;
background:#eee;
padding:0 20px 20px;
overflow:auto;
z-index:1001;
position:absolute;
width: 500px;
min-height: 300px;
}
4. JAVASCRIPT
$(document).ready(function(){
$('.modalLink').modal({
trigger: '.modalLink',
olay:'div.overlay',
modals:'div.modal',
animationEffect: 'slidedown',
animationSpeed: 400,
moveModalSpeed: 'slow',
background: '00c2ff',
opacity: 0.8,
openOnLoad: false,
docClose: true,
closeByEscape: true,
moveOnScroll: true,
resizeWindow: true,
video:'http://player.vimeo.com/video/9641036?color=eb5a3d',
close:'.closeBtn'
});
});
5. OPTIONS
Option |
Default |
Description |
trigger |
.modalLink |
id or class of link or button to trigger modal |
olay |
div.overlay |
id or class of overlay |
modals |
div.modal |
id or class of modal |
animationEffect |
slidedown |
overlay effect | slideDown or fadeIn |
animationSpeed |
400 |
speed of overlay in milliseconds |
moveModalSpeed |
slow |
speed of modal when window is resized |
background |
000000 |
hexidecimal color code - DONT USE # |
opacity |
0.8 |
opacity of overlay |
openOnLoad |
false |
open modal on page load boolean |
docClose |
true |
click document to close boolean |
closeByEscape |
true |
close modal by escape key boolean |
moveOnScroll |
true |
recenter modal when window is scolled boolean |
resizeWindow |
true |
recenter modal when window is resized boolean |
video |
demo |
enter the url of the video |
videoClass |
video |
required: class of the video element(s) |
close |
.closeBtn |
id or class of close button |