diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-06-15 12:47:12 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-06-15 12:47:12 -0400 |
commit | 92fb5567a25080f2064710fc24f0c6c073424cf3 (patch) | |
tree | 641a6f85bf957c07d3c804f5da711028a605bc93 /ui/jquery.ui.effect-clip.js | |
parent | d569b52838594c3e7e732d31dbf07dc2072edfdb (diff) | |
download | jquery-ui-92fb5567a25080f2064710fc24f0c6c073424cf3.tar.gz jquery-ui-92fb5567a25080f2064710fc24f0c6c073424cf3.zip |
Effects: Renamed all files.
Diffstat (limited to 'ui/jquery.ui.effect-clip.js')
-rw-r--r-- | ui/jquery.ui.effect-clip.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/ui/jquery.ui.effect-clip.js b/ui/jquery.ui.effect-clip.js new file mode 100644 index 000000000..0b2d7e24a --- /dev/null +++ b/ui/jquery.ui.effect-clip.js @@ -0,0 +1,66 @@ +/*! + * jQuery UI Effects Clip @VERSION + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Clip + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.clip = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "vertical", + vert = direction === "vertical", + size = vert ? "height" : "width", + position = vert ? "top" : "left", + animation = {}, + wrapper, animate, distance; + + // Save & Show + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + animate = ( el[0].tagName === "IMG" ) ? wrapper : el; + distance = animate[ size ](); + + // Shift + if ( show ) { + animate.css( size, 0 ); + animate.css( position, distance / 2 ); + } + + // Create Animation Object: + animation[ size ] = show ? distance : 0; + animation[ position ] = show ? 0 : distance / 2; + + // Animate + animate.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( !show ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); |