stop() before animate()

This commit is contained in:
rolux 2011-05-28 00:06:56 +02:00
parent 8e6df3d054
commit 2c82f51120

View file

@ -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 {