aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.slide.js
diff options
context:
space:
mode:
authortomykaira <tomykaira@gmail.com>2011-06-09 20:36:48 -0500
committergnarf <gnarf@gnarf.net>2011-06-09 20:38:09 -0500
commit2c8151848d191ad9ba53c0ee86b14aefe4288f67 (patch)
tree43e306d0a16a06772f9b6616e18b539a09de13e3 /ui/jquery.effects.slide.js
parent19dcac2129a2b39a24989835c1c732fa630bdefd (diff)
downloadjquery-ui-2c8151848d191ad9ba53c0ee86b14aefe4288f67.tar.gz
jquery-ui-2c8151848d191ad9ba53c0ee86b14aefe4288f67.zip
effects.core: Convert elements height/width to px and restore after animation in all effects. Fixed #5245 - Relative width elements break when wrapped for effects
Diffstat (limited to 'ui/jquery.effects.slide.js')
-rw-r--r--ui/jquery.effects.slide.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/jquery.effects.slide.js b/ui/jquery.effects.slide.js
index 6b0296754..ccb13fa1b 100644
--- a/ui/jquery.effects.slide.js
+++ b/ui/jquery.effects.slide.js
@@ -18,24 +18,26 @@ $.effects.effect.slide = function( o ) {
// Create element
var el = $( this ),
- props = ['position','top','bottom','left','right'],
+ props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
mode = $.effects.setMode( el, o.mode || 'show' ),
direction = o.direction || 'left',
ref = (direction == 'up' || direction == 'down') ? 'top' : 'left',
motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg',
distance,
- animation = {};
+ animation = {},
+ size;
// Adjust
- $.effects.save( el, props );
+ $.effects.save( el, props );
el.show();
+ distance = o.distance || el[ ref == 'top' ? "outerHeight" : "outerWidth" ]({
+ margin: true
+ });
+
$.effects.createWrapper( el ).css({
overflow: 'hidden'
- });
-
- distance = o.distance || el[ ref == 'top' ? "outerHeight" : "outerWidth" ]({
- margin: true
});
+
if (mode == 'show') {
el.css( ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance );
}