1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00
piwigo_ynh/sources/themes/default/js/ui/jquery.ui.effect-pulsate.js

64 lines
1.3 KiB
JavaScript
Raw Normal View History

2014-07-06 13:21:10 +02:00
/*!
2015-07-05 19:03:18 +02:00
* jQuery UI Effects Pulsate 1.10.4
2014-07-06 13:21:10 +02:00
* http://jqueryui.com
*
2015-07-05 19:03:18 +02:00
* Copyright 2014 jQuery Foundation and other contributors
2014-07-06 13:21:10 +02:00
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/pulsate-effect/
*
* Depends:
* jquery.ui.effect.js
*/
(function( $, undefined ) {
$.effects.effect.pulsate = function( o, done ) {
var elem = $( this ),
mode = $.effects.setMode( elem, o.mode || "show" ),
show = mode === "show",
hide = mode === "hide",
showhide = ( show || mode === "hide" ),
// showing or hiding leaves of the "last" animation
anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
duration = o.duration / anims,
animateTo = 0,
queue = elem.queue(),
queuelen = queue.length,
i;
if ( show || !elem.is(":visible")) {
elem.css( "opacity", 0 ).show();
animateTo = 1;
}
// anims - 1 opacity "toggles"
for ( i = 1; i < anims; i++ ) {
elem.animate({
opacity: animateTo
}, duration, o.easing );
animateTo = 1 - animateTo;
}
elem.animate({
opacity: animateTo
}, duration, o.easing);
elem.queue(function() {
if ( hide ) {
elem.hide();
}
done();
});
// We just queued up "anims" animations, we need to put them next in the queue
if ( queuelen > 1 ) {
queue.splice.apply( queue,
[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
}
elem.dequeue();
};
})(jQuery);