stop() before animate()
This commit is contained in:
parent
8e6df3d054
commit
2c82f51120
1 changed files with 4 additions and 4 deletions
|
@ -779,10 +779,10 @@ Ox.Calendar = function(options, self) {
|
||||||
var delta = (date - self.options.date) / 1000 * getPixelsPerSecond(),
|
var delta = (date - self.options.date) / 1000 * getPixelsPerSecond(),
|
||||||
// 250 ms for half the width of the visible area
|
// 250 ms for half the width of the visible area
|
||||||
ms = 250 * Math.min(Math.abs(delta) / (self.$content.width() / 2), 1);
|
ms = 250 * Math.min(Math.abs(delta) / (self.$content.width() / 2), 1);
|
||||||
self.$scalebar.animate({
|
self.$scalebar.stop().animate({
|
||||||
marginLeft: -delta + 'px'
|
marginLeft: -delta + 'px'
|
||||||
}, ms);
|
}, ms);
|
||||||
self.$content.animate({
|
self.$content.stop().animate({
|
||||||
marginLeft: -delta + 'px'
|
marginLeft: -delta + 'px'
|
||||||
}, ms, function() {
|
}, ms, function() {
|
||||||
self.$scalebar.stop().css({marginLeft: 0});
|
self.$scalebar.stop().css({marginLeft: 0});
|
||||||
|
@ -791,7 +791,7 @@ Ox.Calendar = function(options, self) {
|
||||||
self.options.date = date;
|
self.options.date = date;
|
||||||
renderCalendar();
|
renderCalendar();
|
||||||
});
|
});
|
||||||
self.$scrollbar.animate({
|
self.$scrollbar.stop().animate({
|
||||||
marginLeft: -delta / getScrollbarFactor() + 'px'
|
marginLeft: -delta / getScrollbarFactor() + 'px'
|
||||||
}, ms);
|
}, ms);
|
||||||
if (!Ox.isUndefined(line)) {
|
if (!Ox.isUndefined(line)) {
|
||||||
|
@ -964,7 +964,7 @@ Ox.Calendar = function(options, self) {
|
||||||
delta = top - scrollTop,
|
delta = top - scrollTop,
|
||||||
ms = 250 * Math.min(Math.abs(delta) / (containerHeight / 2), 1);
|
ms = 250 * Math.min(Math.abs(delta) / (containerHeight / 2), 1);
|
||||||
if (animate) {
|
if (animate) {
|
||||||
self.$container.animate({
|
self.$container.stop().animate({
|
||||||
scrollTop: top
|
scrollTop: top
|
||||||
}, ms);
|
}, ms);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue