Skip to content
Permalink
Browse files

slider: animate is a bit smoother now - stops the previous animation

  • Loading branch information
Paul Bakaus
Paul Bakaus committed Jul 3, 2008
1 parent c0710fb commit 17b2d9526ab9fec734e054ce06a31040e1c0ab3c
Showing with 2 additions and 2 deletions.
  1. +2 −2 ui/ui.slider.js
@@ -400,15 +400,15 @@ $.widget("ui.slider", {
x = this.translateLimits(x, "x");
x = this.translateRange(x, "x");

o.animate ? this.currentHandle.animate({ left: x }, (Math.abs(parseInt(this.currentHandle.css("left")) - x)) * (!isNaN(parseInt(o.animate)) ? o.animate : 5)) : this.currentHandle.css({ left: x });
o.animate ? this.currentHandle.stop().animate({ left: x }, (Math.abs(parseInt(this.currentHandle.css("left")) - x)) * (!isNaN(parseInt(o.animate)) ? o.animate : 5)) : this.currentHandle.css({ left: x });
}

if(o.axis != "horizontal" && y !== undefined) {
if(o.stepping.y) y = Math.round(y / o.stepping.y) * o.stepping.y;
y = this.translateValue(y, "y");
y = this.translateLimits(y, "y");
y = this.translateRange(y, "y");
o.animate ? this.currentHandle.animate({ top: y }, (Math.abs(parseInt(this.currentHandle.css("top")) - y)) * (!isNaN(parseInt(o.animate)) ? o.animate : 5)) : this.currentHandle.css({ top: y });
o.animate ? this.currentHandle.stop().animate({ top: y }, (Math.abs(parseInt(this.currentHandle.css("top")) - y)) * (!isNaN(parseInt(o.animate)) ? o.animate : 5)) : this.currentHandle.css({ top: y });
}

if (this.rangeElement)

0 comments on commit 17b2d95

Please sign in to comment.
You can’t perform that action at this time.