diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-08-21 00:12:17 -0400 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-08-21 08:06:24 -0400 |
commit | de242d8ca9bf2b90237c413cb91601541798bae9 (patch) | |
tree | 42658e1e9ed913dbb5a7c11291df74531f503995 /ui/effects | |
parent | 009850abbfb78e2334aaf9265abf5a7705a2abf0 (diff) | |
download | jquery-ui-de242d8ca9bf2b90237c413cb91601541798bae9.tar.gz jquery-ui-de242d8ca9bf2b90237c413cb91601541798bae9.zip |
Effects: Style updates
Ref #14246
Ref gh-1588
Diffstat (limited to 'ui/effects')
-rw-r--r-- | ui/effects/effect-bounce.js | 13 | ||||
-rw-r--r-- | ui/effects/effect-explode.js | 10 |
2 files changed, 12 insertions, 11 deletions
diff --git a/ui/effects/effect-bounce.js b/ui/effects/effect-bounce.js index 06bc84426..1743ef503 100644 --- a/ui/effects/effect-bounce.js +++ b/ui/effects/effect-bounce.js @@ -33,7 +33,7 @@ return $.effects.define( "bounce", function( options, done ) { var upAnim, downAnim, refValue, element = $( this ), - // defaults: + // Defaults: mode = options.mode, hide = mode === "hide", show = mode === "show", @@ -41,12 +41,12 @@ return $.effects.define( "bounce", function( options, done ) { distance = options.distance, times = options.times || 5, - // number of internal animations + // Number of internal animations anims = times * 2 + ( show || hide ? 1 : 0 ), speed = options.duration / anims, easing = options.easing, - // utility: + // Utility: ref = ( direction === "up" || direction === "down" ) ? "top" : "left", motion = ( direction === "up" || direction === "left" ), i = 0, @@ -57,7 +57,7 @@ return $.effects.define( "bounce", function( options, done ) { refValue = element.css( ref ); - // default distance for the BIGGEST bounce is the outer Distance / 3 + // Default distance for the BIGGEST bounce is the outer Distance / 3 if ( !distance ) { distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; } @@ -66,7 +66,7 @@ return $.effects.define( "bounce", function( options, done ) { downAnim = { opacity: 1 }; downAnim[ ref ] = refValue; - // if we are showing, force opacity 0 and set the initial position + // If we are showing, force opacity 0 and set the initial position // then do the "first" animation element .css( "opacity", 0 ) @@ -74,13 +74,14 @@ return $.effects.define( "bounce", function( options, done ) { .animate( downAnim, speed, easing ); } - // start at the smallest distance if we are hiding + // Start at the smallest distance if we are hiding if ( hide ) { distance = distance / Math.pow( 2, times - 1 ); } downAnim = {}; downAnim[ ref ] = refValue; + // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here for ( ; i < times; i++ ) { upAnim = {}; diff --git a/ui/effects/effect-explode.js b/ui/effects/effect-explode.js index 55c247d3e..92b83f545 100644 --- a/ui/effects/effect-explode.js +++ b/ui/effects/effect-explode.js @@ -38,15 +38,15 @@ return $.effects.define( "explode", "hide", function( options, done ) { mode = options.mode, show = mode === "show", - // show and then visibility:hidden the element before calculating offset + // Show and then visibility:hidden the element before calculating offset offset = element.show().css( "visibility", "hidden" ).offset(), - // width and height of a piece + // Width and height of a piece width = Math.ceil( element.outerWidth() / cells ), height = Math.ceil( element.outerHeight() / rows ), pieces = []; - // children animate complete: + // Children animate complete: function childComplete() { pieces.push( this ); if ( pieces.length === rows * cells ) { @@ -54,7 +54,7 @@ return $.effects.define( "explode", "hide", function( options, done ) { } } - // clone the element for each row and cell. + // Clone the element for each row and cell. for ( i = 0; i < rows; i++ ) { // ===> top = offset.top + i * height; my = i - ( rows - 1 ) / 2; @@ -76,7 +76,7 @@ return $.effects.define( "explode", "hide", function( options, done ) { top: -i * height } ) - // select the wrapper - make it overflow: hidden and absolute positioned based on + // Select the wrapper - make it overflow: hidden and absolute positioned based on // where the original was located +left and +top equal to the size of pieces .parent() .addClass( "ui-effects-explode" ) |