相关疑难解决方法(0)

在它的幻灯片结尾处停止Twitter Bootstrap Carousel

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)

更新:这与"自动播放"无关我特别指的是手动按下左右按钮.

javascript jquery carousel twitter-bootstrap

15
推荐指数
3
解决办法
3万
查看次数

标签 统计

carousel ×1

javascript ×1

jquery ×1

twitter-bootstrap ×1