Edit File by line
/home/barbar84/public_h.../wp-inclu.../js/jquery/ui
File: effect-bounce.js
/*!
[0] Fix | Delete
* jQuery UI Effects Bounce 1.12.1
[1] Fix | Delete
* http://jqueryui.com
[2] Fix | Delete
*
[3] Fix | Delete
* Copyright jQuery Foundation and other contributors
[4] Fix | Delete
* Released under the MIT license.
[5] Fix | Delete
* http://jquery.org/license
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
//>>label: Bounce Effect
[9] Fix | Delete
//>>group: Effects
[10] Fix | Delete
//>>description: Bounces an element horizontally or vertically n times.
[11] Fix | Delete
//>>docs: http://api.jqueryui.com/bounce-effect/
[12] Fix | Delete
//>>demos: http://jqueryui.com/effect/
[13] Fix | Delete
[14] Fix | Delete
( function( factory ) {
[15] Fix | Delete
if ( typeof define === "function" && define.amd ) {
[16] Fix | Delete
[17] Fix | Delete
// AMD. Register as an anonymous module.
[18] Fix | Delete
define( [
[19] Fix | Delete
"jquery",
[20] Fix | Delete
"./effect"
[21] Fix | Delete
], factory );
[22] Fix | Delete
} else {
[23] Fix | Delete
[24] Fix | Delete
// Browser globals
[25] Fix | Delete
factory( jQuery );
[26] Fix | Delete
}
[27] Fix | Delete
}( function( $ ) {
[28] Fix | Delete
[29] Fix | Delete
return $.effects.define( "bounce", function( options, done ) {
[30] Fix | Delete
var upAnim, downAnim, refValue,
[31] Fix | Delete
element = $( this ),
[32] Fix | Delete
[33] Fix | Delete
// Defaults:
[34] Fix | Delete
mode = options.mode,
[35] Fix | Delete
hide = mode === "hide",
[36] Fix | Delete
show = mode === "show",
[37] Fix | Delete
direction = options.direction || "up",
[38] Fix | Delete
distance = options.distance,
[39] Fix | Delete
times = options.times || 5,
[40] Fix | Delete
[41] Fix | Delete
// Number of internal animations
[42] Fix | Delete
anims = times * 2 + ( show || hide ? 1 : 0 ),
[43] Fix | Delete
speed = options.duration / anims,
[44] Fix | Delete
easing = options.easing,
[45] Fix | Delete
[46] Fix | Delete
// Utility:
[47] Fix | Delete
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
[48] Fix | Delete
motion = ( direction === "up" || direction === "left" ),
[49] Fix | Delete
i = 0,
[50] Fix | Delete
[51] Fix | Delete
queuelen = element.queue().length;
[52] Fix | Delete
[53] Fix | Delete
$.effects.createPlaceholder( element );
[54] Fix | Delete
[55] Fix | Delete
refValue = element.css( ref );
[56] Fix | Delete
[57] Fix | Delete
// Default distance for the BIGGEST bounce is the outer Distance / 3
[58] Fix | Delete
if ( !distance ) {
[59] Fix | Delete
distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
if ( show ) {
[63] Fix | Delete
downAnim = { opacity: 1 };
[64] Fix | Delete
downAnim[ ref ] = refValue;
[65] Fix | Delete
[66] Fix | Delete
// If we are showing, force opacity 0 and set the initial position
[67] Fix | Delete
// then do the "first" animation
[68] Fix | Delete
element
[69] Fix | Delete
.css( "opacity", 0 )
[70] Fix | Delete
.css( ref, motion ? -distance * 2 : distance * 2 )
[71] Fix | Delete
.animate( downAnim, speed, easing );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
// Start at the smallest distance if we are hiding
[75] Fix | Delete
if ( hide ) {
[76] Fix | Delete
distance = distance / Math.pow( 2, times - 1 );
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
downAnim = {};
[80] Fix | Delete
downAnim[ ref ] = refValue;
[81] Fix | Delete
[82] Fix | Delete
// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
[83] Fix | Delete
for ( ; i < times; i++ ) {
[84] Fix | Delete
upAnim = {};
[85] Fix | Delete
upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
[86] Fix | Delete
[87] Fix | Delete
element
[88] Fix | Delete
.animate( upAnim, speed, easing )
[89] Fix | Delete
.animate( downAnim, speed, easing );
[90] Fix | Delete
[91] Fix | Delete
distance = hide ? distance * 2 : distance / 2;
[92] Fix | Delete
}
[93] Fix | Delete
[94] Fix | Delete
// Last Bounce when Hiding
[95] Fix | Delete
if ( hide ) {
[96] Fix | Delete
upAnim = { opacity: 0 };
[97] Fix | Delete
upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
[98] Fix | Delete
[99] Fix | Delete
element.animate( upAnim, speed, easing );
[100] Fix | Delete
}
[101] Fix | Delete
[102] Fix | Delete
element.queue( done );
[103] Fix | Delete
[104] Fix | Delete
$.effects.unshift( element, queuelen, anims + 1 );
[105] Fix | Delete
} );
[106] Fix | Delete
[107] Fix | Delete
} ) );
[108] Fix | Delete
[109] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function