Bootstrap旋转木马是一个奇怪的野兽.我已经尝试调整$ next以防止无限循环,但最终要么打破它,要么阻止幻灯片在到达结尾时向后移动.
我希望旋转木马只在列表中滑动而不是无限循环.
任何帮助,将不胜感激.
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
if ($next.hasClass('active')) return
if ($.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
this.$element.one($.support.transition.end, function() {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function() {
that.$element.trigger('slid')
}, 0)
})
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid')
}
Run Code Online (Sandbox Code Playgroud)
更新:这与"自动播放"无关我特别指的是手动按下左右按钮.