Super Tiny jQuery Popup Modal Plugin - justPopup
File Size: | 7.27 |
---|---|
Views Total: | 3422 |
Last Update: | |
Publish Date: | |
Official Website: | Go to website |
License: | MIT |

justPopup is an extremely simple and easy-to-use jQuery plugin that allows you to create a simple modal box with a close button.
How to use it:
1. Include jQuery library and justPopup plugin on the page
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="js/jquery.justPopup.min.js"></script>
2. Markup
<div id="display"> Click Me </div> <div class="overlay"> <div class="inner"> <div class="content"> Modal box </div> <span class="close"></span> </div> <div class="transparency"></div>
3. The CSS
body { font: bold 30px Verdana; } #display { color: white; margin: 50px auto; width: 400px; height: 100px; background-color: #E48743; cursor: pointer; text-align: center; line-height: 100px; } #display:hover { background-color: #7EB5D6; } .overlay { visibility: hidden; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; text-align: center; } .inner { position: absolute; top: 50%; left: 50%; width: 500px; height: 300px; margin-top: -150px; margin-left: -250px; background-color: #7EB5D6; text-align: center; z-index: 1; box-shadow: 0 2px 12px #333; -ms-box-shadow: 0 2px 12px #333; -moz-box-shadow: 0 2px 12px #333; -webkit-box-shadow: 0 2px 12px #333; border-radius: 8px; -ms-border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; border: 1px solid #666; } .transparency { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000000; zoom: 1; filter: alpha(opacity=60); opacity: 0.6; } .close { display: block; position: absolute; top: -8px; right: -8px; height: 0; width: 18px; padding: 18px 0 0 0; overflow: hidden; background: #000000 none; border: 2px solid #ffffff; -moz-border-radius: 18px; -webkit-border-radius: 18px; border-radius: 18px; box-shadow: 0 0 6px #000000, 1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), 1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3); -ms-box-shadow: 0 0 6px #000000, 1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), 1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 0 6px #000000, 1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), 1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3); -webkit-box-shadow: 0 0 6px #000000, 1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px 1.6px 1.6px rgba(0, 0, 0, 0.3), 1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3), -1.6px -1.6px 1.6px rgba(0, 0, 0, 0.3); color: #ffffff; cursor: pointer; -moz-user-select: none; -webkit-user-select: none; user-select: none; } .close:before { content: "\D7"; display: block; text-align: center; width: 18px; position: absolute; top: -2px; left: 0; font-size: 18px; line-height: 18px; font-family: "Helvetica Neue", Consolas, Verdana, Tahoma, Calibri, Helvetica, Menlo, "Droid Sans", sans-serif; } .content { color: white; width: 300px; line-height: 50px; }
4. Call the plugin
<script type="text/javascript"> $(function() { $("#display").justPopup(); }); </script>
This awesome jQuery plugin is developed by geniuscarrier. For more Advanced Usages, please check the demo page or visit the official website.