From 2c82f511203fe6e0501d058827d1b24f53305710 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 28 May 2011 00:06:56 +0200 Subject: [PATCH] stop() before animate() --- source/Ox.UI/js/Calendar/Ox.Calendar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index 9b0f93f0..1f58da25 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -779,10 +779,10 @@ Ox.Calendar = function(options, self) { var delta = (date - self.options.date) / 1000 * getPixelsPerSecond(), // 250 ms for half the width of the visible area ms = 250 * Math.min(Math.abs(delta) / (self.$content.width() / 2), 1); - self.$scalebar.animate({ + self.$scalebar.stop().animate({ marginLeft: -delta + 'px' }, ms); - self.$content.animate({ + self.$content.stop().animate({ marginLeft: -delta + 'px' }, ms, function() { self.$scalebar.stop().css({marginLeft: 0}); @@ -791,7 +791,7 @@ Ox.Calendar = function(options, self) { self.options.date = date; renderCalendar(); }); - self.$scrollbar.animate({ + self.$scrollbar.stop().animate({ marginLeft: -delta / getScrollbarFactor() + 'px' }, ms); if (!Ox.isUndefined(line)) { @@ -964,7 +964,7 @@ Ox.Calendar = function(options, self) { delta = top - scrollTop, ms = 250 * Math.min(Math.abs(delta) / (containerHeight / 2), 1); if (animate) { - self.$container.animate({ + self.$container.stop().animate({ scrollTop: top }, ms); } else {