Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions js/bootstrap-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
}

, slide: function (type, next) {
if(!$.support.transition && this.$element.hasClass('slide')) {
this.$element.find('.item').stop(true, true); //Finish animation and jump to end.
}
var $active = this.$element.find('.active')
, $next = next || $active[type]()
, isCycling = this.interval
Expand Down Expand Up @@ -109,6 +112,17 @@
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
})
}else if(!$.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.animate({left: (direction == 'right' ? '100%' : '-100%')}, 600, function(){
$active.removeClass('active')
that.sliding = false
setTimeout(function () { that.$element.trigger('slid') }, 0)
})
$next.addClass(type).css({left: (direction == 'right' ? '-100%' : '100%')}).animate({left: '0'}, 600, function(){
$next.removeClass(type).addClass('active')
})
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
Expand Down
2 changes: 1 addition & 1 deletion less/carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
display: none;
position: relative;
.transition(.6s ease-in-out left);
width: 100%;
}

// Account for jankitude on images
Expand All @@ -39,7 +40,6 @@
.prev {
position: absolute;
top: 0;
width: 100%;
}

.next {
Expand Down