2 * jQuery UI Effects Pulsate 1.9.2
5 * Copyright 2012 jQuery Foundation and other contributors
6 * Released under the MIT license.
7 * http://jquery.org/license
9 * http://api.jqueryui.com/pulsate-effect/
14 (function( $, undefined ) {
16 $.effects.effect.pulsate = function( o, done ) {
18 mode = $.effects.setMode( elem, o.mode || "show" ),
19 show = mode === "show",
20 hide = mode === "hide",
21 showhide = ( show || mode === "hide" ),
23 // showing or hiding leaves of the "last" animation
24 anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
25 duration = o.duration / anims,
28 queuelen = queue.length,
31 if ( show || !elem.is(":visible")) {
32 elem.css( "opacity", 0 ).show();
36 // anims - 1 opacity "toggles"
37 for ( i = 1; i < anims; i++ ) {
40 }, duration, o.easing );
41 animateTo = 1 - animateTo;
46 }, duration, o.easing);
48 elem.queue(function() {
55 // We just queued up "anims" animations, we need to put them next in the queue
57 queue.splice.apply( queue,
58 [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );