[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/jquery/ui/ -> effect-blind.js (source)

   1  /*!
   2   * jQuery UI Effects Blind 1.13.1
   3   * http://jqueryui.com
   4   *
   5   * Copyright jQuery Foundation and other contributors
   6   * Released under the MIT license.
   7   * http://jquery.org/license
   8   */
   9  
  10  //>>label: Blind Effect
  11  //>>group: Effects
  12  //>>description: Blinds the element.
  13  //>>docs: http://api.jqueryui.com/blind-effect/
  14  //>>demos: http://jqueryui.com/effect/
  15  
  16  ( function( factory ) {
  17      "use strict";
  18  
  19      if ( typeof define === "function" && define.amd ) {
  20  
  21          // AMD. Register as an anonymous module.
  22          define( [
  23              "jquery",
  24              "./effect"
  25          ], factory );
  26      } else {
  27  
  28          // Browser globals
  29          factory( jQuery );
  30      }
  31  } )( function( $ ) {
  32  "use strict";
  33  
  34  return $.effects.define( "blind", "hide", function( options, done ) {
  35      var map = {
  36              up: [ "bottom", "top" ],
  37              vertical: [ "bottom", "top" ],
  38              down: [ "top", "bottom" ],
  39              left: [ "right", "left" ],
  40              horizontal: [ "right", "left" ],
  41              right: [ "left", "right" ]
  42          },
  43          element = $( this ),
  44          direction = options.direction || "up",
  45          start = element.cssClip(),
  46          animate = { clip: $.extend( {}, start ) },
  47          placeholder = $.effects.createPlaceholder( element );
  48  
  49      animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
  50  
  51      if ( options.mode === "show" ) {
  52          element.cssClip( animate.clip );
  53          if ( placeholder ) {
  54              placeholder.css( $.effects.clipToBox( animate ) );
  55          }
  56  
  57          animate.clip = start;
  58      }
  59  
  60      if ( placeholder ) {
  61          placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
  62      }
  63  
  64      element.animate( animate, {
  65          queue: false,
  66          duration: options.duration,
  67          easing: options.easing,
  68          complete: done
  69      } );
  70  } );
  71  
  72  } );


Generated: Thu Apr 25 01:00:03 2024 Cross-referenced by PHPXref 0.7.1