Continuous carousel speed control
I have a button that calls an animate function:
$(document).on("click", this.settings.startButton, function () {
$(self.settings.itemClass).each(function (i, item) {
self.animateItem(this, 100, self);
});
})
and my animate function looks like this:
animateItem: function (item, speed, self) {
var width = $(item).outerWidth(true);
var containerWidth = $(self.settings.itemContainerClass).width();
var left = parseInt($(item).css("left"));
if (left < 0) {
$(item).css("left", containerWidth - (2 * width) + "px");
self.animateItem(item, speed, self);
} else {
$(item).animate({ "left": left - width + "px" }, {
duration: speed,
complete: function () {
self.animateItem(this, speed, self);
}
});
}
}
Now, when the animateItem function is called, everything works fine. The
Carousel is moving fast but what I want is to control the speed. I would
like to start of fairly slow and quickly progress to very fast and then
slowly stop.
Does anyone know of a way I can get that to happen?
If you need to see my html or css, just let me know.
Cheers, /r3plica
No comments:
Post a Comment