Mercurial > hg > ismi-richfaces
view src/main/webapp/imageServer/resources/js/jquery-ui-1.10.4/ui/jquery.ui.effect-clip.js @ 205:f719d73383db
Merge iiif_diva branch
964846688a95cc9b0af5ade832b8d34ae4a4bc21
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 08 Jul 2019 17:55:14 +0200 |
parents | 764f47286679 |
children |
line wrap: on
line source
/*! * jQuery UI Effects Clip 1.10.4 * http://jqueryui.com * * Copyright 2014 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);