Download
Demo
- Overview
- Documents
User Rating: 0/5 ( 0 votes)
Your Rating:
CoverPop.js is a lightweight lightbox'y modal plugin with cookie integration. Style agnostic and responsive friendly.
Source: coverpopjs.com
1. INCLUDE JS AND CSS FILES
<script src="js/CoverPop.js"></script> <link rel="stylesheet" href="css/CoverPop.css">
2. HTML
<!-- start popup -->
<div id="CoverPop-cover" class="splash">
<div class="CoverPop-content splash-center">
<!-- the popup content (form, welcome message, etc.) -->
<a class="CoverPop-close" href="#">or skip signup</a>
</div><!--end .splash-center -->
</div><!--end .splash -->
<!-- end popup -->
#CoverPop-cover is used on the full window cover.
By default, a click on any element with .CoverPop-close will close the popup. The plugin uses preventDefault with elements with this class.
If you wish to continue with the default action, but also hide the popup, add .CoverPop-close-go. This is particularly useful for form submissions that are sent to another page.
3. JAVASCRIPT
CoverPop.start();
4. OPTIONS
CoverPop.start({
coverId: 'CoverPop-cover', // set default cover id
expires: 30, // duration (in days) before it pops up again
closeClassNoDefault: 'CoverPop-close', // close if someone clicks an element with this class and prevent default action
closeClassDefault: 'CoverPop-close-go', // close if someone clicks an element with this class and continue default action
cookieName: '_CoverPop', // to change the plugin cookie name
onPopUpOpen: function() {}, // on popup open callback function
onPopUpClose: function() {}, // on popup close callback function
forceHash: 'splash', // hash to append to url to force display of popup (e.g. http://yourdomain.com/#splash)
delayHash: 'go', // hash to append to url to delay popup for 1 day (e.g. http://yourdomain.com/#go)
closeOnEscape: true, // close if the user clicks escape
debug: false // toggle console.log statements
});
JS Tutorial
