2 * jQuery UI Effects Pulsate 1.11.2
5 * Copyright 2014 jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/pulsate-effect/
11 (function( factory ) {
12 if ( typeof define === "function" && define.amd ) {
14 // AMD. Register as an anonymous module.
26 return $.effects.effect.pulsate = function( o, done ) {
28 mode = $.effects.setMode( elem, o.mode || "show" ),
29 show = mode === "show",
30 hide = mode === "hide",
31 showhide = ( show || mode === "hide" ),
33 // showing or hiding leaves of the "last" animation
34 anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
35 duration = o.duration / anims,
38 queuelen = queue.length,
41 if ( show || !elem.is(":visible")) {
42 elem.css( "opacity", 0 ).show();
46 // anims - 1 opacity "toggles"
47 for ( i = 1; i < anims; i++ ) {
50 }, duration, o.easing );
51 animateTo = 1 - animateTo;
56 }, duration, o.easing);
58 elem.queue(function() {
65 // We just queued up "anims" animations, we need to put them next in the queue
67 queue.splice.apply( queue,
68 [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );