Plugin Directory

Changeset 622790


Ignore:
Timestamp:
11/09/2012 01:54:37 AM (13 years ago)
Author:
emcniece
Message:

Code/comments updating

Location:
emc2-alert-boxes/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • emc2-alert-boxes/trunk/emc2-alert-boxes.js

    r615474 r622790  
    1 // EMC2 Alert Box jQuery
    2 jQuery(document).ready(function($) {
    3    
    4     // Move alert if fixed to page
    5     $('.emc2-alert-box.fixed').prependTo('body');
    6 
    7     // Close button
    8     $('.emc2alert-close').live('click', function(){
    9         if( $(this).parents('.emc2-alert-box').hasClass('animate') ){
    10             // Animated closing
    11             $(this).parents('.emc2-alert-box').slideUp(250, 'swing', function(){
    12                 $(this).remove();   
    13             });
    14         } else {
    15             $(this).parents('.emc2-alert-box').remove();
    16         } // if animated
    17     });
    18        
    19 });
    20 
    21 
    221/* ********************************************************
    232 * 
     
    4625 * 
    4726 ******************************************************** */
     27
     28/* *************************
     29 *  $(document).ready()
     30 * 
     31 *  Adds click/close functionality
     32 *  and prepends to body if needed
     33 *
     34 ************************ */
     35jQuery(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 ************************ */
    4872
    4973(function($){ 
  • emc2-alert-boxes/trunk/emc2-alert-boxes.php

    r618435 r622790  
    1010*/
    1111
    12 
    1312require_once(ABSPATH . '/wp-admin/includes/plugin.php');
    1413require_once(ABSPATH . WPINC . '/pluggable.php');
    1514require_once('emc2alert-options.php');
     15
    1616/* ********************************************************
    1717 * 
Note: See TracChangeset for help on using the changeset viewer.