Changeset 622790
- Timestamp:
- 11/09/2012 01:54:37 AM (13 years ago)
- Location:
- emc2-alert-boxes/trunk
- Files:
-
- 2 edited
-
emc2-alert-boxes.js (modified) (2 diffs)
-
emc2-alert-boxes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
emc2-alert-boxes/trunk/emc2-alert-boxes.js
r615474 r622790 1 // EMC2 Alert Box jQuery2 jQuery(document).ready(function($) {3 4 // Move alert if fixed to page5 $('.emc2-alert-box.fixed').prependTo('body');6 7 // Close button8 $('.emc2alert-close').live('click', function(){9 if( $(this).parents('.emc2-alert-box').hasClass('animate') ){10 // Animated closing11 $(this).parents('.emc2-alert-box').slideUp(250, 'swing', function(){12 $(this).remove();13 });14 } else {15 $(this).parents('.emc2-alert-box').remove();16 } // if animated17 });18 19 });20 21 22 1 /* ******************************************************** 23 2 * … … 46 25 * 47 26 ******************************************************** */ 27 28 /* ************************* 29 * $(document).ready() 30 * 31 * Adds click/close functionality 32 * and prepends to body if needed 33 * 34 ************************ */ 35 jQuery(document).ready(function($) { 36 37 // Move alert if fixed to page 38 $('.emc2-alert-box.fixed').prependTo('body'); 39 40 // Close button 41 $('.emc2alert-close').live('click', function(){ 42 if( $(this).parents('.emc2-alert-box').hasClass('animate') ){ 43 // Animated closing 44 $(this).parents('.emc2-alert-box').slideUp(250, 'swing', function(){ 45 $(this).remove(); 46 }); 47 } else { 48 $(this).parents('.emc2-alert-box').remove(); 49 } // if animated 50 }); 51 52 }); 53 54 55 /* ************************* 56 57 $().emc2alert({ 58 title: "Your Title", // or $('myTitleDiv').html() 59 text: "Your Message", // or $('myMsgDiv').html() 60 type: "info", // 'info', 'warning', 'error', 'success' - determines bg colors 61 style: "normal", // 'normal', 'fixed' - in page or fixed to top or bottom 62 visible: true, // true, false - hides if necessary 63 position: "top", // 'top', 'bottom' - positions box on page 64 width: null, // '100%', '960px' - specify units 65 closebtn: false, // true, false - displays close button in corner 66 wpbar: false, // true, false, 'auto' - adds top margin to avoid admin bar, with auto-detect 67 animate: false // true, false - adds open/close animation 68 }); 69 70 * 71 ************************ */ 48 72 49 73 (function($){ -
emc2-alert-boxes/trunk/emc2-alert-boxes.php
r618435 r622790 10 10 */ 11 11 12 13 12 require_once(ABSPATH . '/wp-admin/includes/plugin.php'); 14 13 require_once(ABSPATH . WPINC . '/pluggable.php'); 15 14 require_once('emc2alert-options.php'); 15 16 16 /* ******************************************************** 17 17 *
Note: See TracChangeset
for help on using the changeset viewer.