From: Scott González Date: Tue, 9 Nov 2010 13:38:06 +0000 (-0500) Subject: Slide effect: Handle string values for distance. Fixes #6637 - Slide effect is jumpy... X-Git-Tag: 1.8.7~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=412d1aa1c9ac0a8a933710fef6d233a061fb9d13;p=jquery-ui.git Slide effect: Handle string values for distance. Fixes #6637 - Slide effect is jumpy with certain parameter combinations. Thanks Jeff Roush. --- diff --git a/ui/jquery.effects.slide.js b/ui/jquery.effects.slide.js index 5ada8a09a..56d8452e1 100644 --- a/ui/jquery.effects.slide.js +++ b/ui/jquery.effects.slide.js @@ -29,7 +29,7 @@ $.effects.slide = function(o) { var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left'; var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg'; var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true})); - if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift + if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift // Animation var animation = {};