[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  /*!
   2   * jQuery UI Effects Clip 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: Clip Effect
  11  //>>group: Effects
  12  //>>description: Clips the element on and off like an old TV.
  13  //>>docs: http://api.jqueryui.com/clip-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( "clip", "hide", function( options, done ) {
  35      var start,
  36          animate = {},
  37          element = $( this ),
  38          direction = options.direction || "vertical",
  39          both = direction === "both",
  40          horizontal = both || direction === "horizontal",
  41          vertical = both || direction === "vertical";
  42  
  43      start = element.cssClip();
  44      animate.clip = {
  45          top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
  46          right: horizontal ? ( start.right - start.left ) / 2 : start.right,
  47          bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
  48          left: horizontal ? ( start.right - start.left ) / 2 : start.left
  49      };
  50  
  51      $.effects.createPlaceholder( element );
  52  
  53      if ( options.mode === "show" ) {
  54          element.cssClip( animate.clip );
  55          animate.clip = start;
  56      }
  57  
  58      element.animate( animate, {
  59          queue: false,
  60          duration: options.duration,
  61          easing: options.easing,
  62          complete: done
  63      } );
  64  
  65  } );
  66  
  67  } );


Generated: Fri Nov 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1