Download
Demo
- Overview
- Documents
User Rating: 0/5 ( 0 votes)
Your Rating:
ClassyPopup is quick, simple, and easy plugin to use for all of your popup needs. It is highly customizable, and very intuitive to use.
Source: class.pm
1. INCLUDE JS AND CSS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="js/jquery.classypopup.min.js"></script> <link rel="stylesheet" type="text/css" href="css/jquery.classypopup.min.css" />
2. HTML
<input id="small" type="button" class="flat bgFix" value="Small" />
3. JAVASCRIPT
$(document).ready(function() { ClassyPopup.init({ override: true, background: 'white', centerOnResize: true, fade: true }); $('#small').click(function() { ClassyPopup.alert({ width: '200px', title: '200px', rightButtons: ['OK'], onOpen: function() { $('<span />').html("I am Small. <br />width: '200px',").appendTo('.pcontent'); } }); }); }):
4. OPTIONS
- override - if set to true, calling alert(text) will fire ClassyPopup with your text inside, can be true or false
- background - used to specify the background shade, can be white, black, or none
- centerOnResize - used to specify whether the popup should stay centered on window resize, can be true or false
- fade - used to specify whether the popup should fade in or appear instantly, can be true or false
- text - the message displayed in the content pane
- width - specify the ClassyPopup's width, should be a CSS String, e.g. "300px", "55%", etc
- title - specify the ClassyPopup's title.
- leftButtons - add buttons on the left side of the popup
- rightButtons - add buttons on the right side of the popup
5. CALLBACKS
- onOpen - callback function for when the popup has fully opened. Perfect for loading data via ajax to the content pane (.pcontent)
- onClick - callback function for when a button is clicked. If a button was titled "Enter", the parameter of this function will be "Enter". Used with switch/if else statements, one can add any functionality they want to each button