Sha256: 2c918dde746c77d569fd05f6062c7fdf191f7ddfe9dd43298ae90cf27ad604ef

Contents?: true

Size: 1.44 KB

Versions: 13

Compression:

Stored size: 1.44 KB

Contents

/*!
 * jQuery UI Effects Clip @VERSION
 * http://jqueryui.com
 *
 * Copyright 2012 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/clip-effect/
 *
 * 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);

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-1.0.0 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.39 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.38 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.37 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.35 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.34 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.33 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.32 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.31 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.30 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.29 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js
spiderfw-0.6.28 apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/jquery.ui.effect-clip.js