Skip to content

Commit 412d1aa

Browse files
committed
Slide effect: Handle string values for distance. Fixes #6637 - Slide effect is jumpy with certain parameter combinations.
Thanks Jeff Roush.
1 parent 4226fae commit 412d1aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.effects.slide.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $.effects.slide = function(o) {
2929
var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
3030
var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
3131
var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
32-
if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); // Shift
32+
if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift
3333

3434
// Animation
3535
var animation = {};

0 commit comments

Comments
 (0)