2 * jQuery UI Effects Clip 1.9.2
5 * Copyright 2012 jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/clip-effect/
14 (function( $, undefined ) {
16 $.effects
.effect
.clip = function( o
, done
) {
19 props
= [ "position", "top", "bottom", "left", "right", "height", "width" ],
20 mode
= $.effects
.setMode( el
, o
.mode
|| "hide" ),
21 show
= mode
=== "show",
22 direction
= o
.direction
|| "vertical",
23 vert
= direction
=== "vertical",
24 size
= vert
? "height" : "width",
25 position
= vert
? "top" : "left",
27 wrapper
, animate
, distance
;
30 $.effects
.save( el
, props
);
34 wrapper
= $.effects
.createWrapper( el
).css({
37 animate
= ( el
[0].tagName
=== "IMG" ) ? wrapper
: el
;
38 distance
= animate
[ size
]();
42 animate
.css( size
, 0 );
43 animate
.css( position
, distance
/ 2 );
46 // Create Animation Object:
47 animation
[ size
] = show
? distance
: 0;
48 animation
[ position
] = show
? 0 : distance
/ 2;
51 animate
.animate( animation
, {
55 complete: function() {
59 $.effects
.restore( el
, props
);
60 $.effects
.removeWrapper( el
);