2014-09-24 84 views
0

在Bootstrap传送带中,我添加了触摸支持(bootstrap-touch-carousel.js)。在该间隔周期后停止工作,它将在上次滑动后停止,我希望它无限循环。它在网上工作,但不能在移动设备上工作。我的代码如下:Bootstrap触摸传送带需要无限循环

$('.carousel').carousel({ 
       interval: 2000, 
       pause: "false" 
        }); 
+0

什么的引导,触摸转盘。 js或从哪里来? – cvrebert 2014-09-24 08:18:24

回答

0

这里是解决方案,为我工作:

查找:

f.prototype._showPane = function(a) { 
    this.$items.eq(this.current_pane).toggleClass("active"), a >= this.pane_count && this.pause(), a = Math.max(0, Math.min(a, this.pane_count - 1)), this.$items.eq(a).toggleClass("active"), this.current_pane = a; 
    var b = -(100/this.pane_count * this.current_pane); 
    return this._setContainerOffset(b, !0, a), this 
} 

替换为:

f.prototype._showPane = function(a) { 
    if (a >= this.$items.length){ a = 0; } 
    this.$items.eq(this.current_pane).toggleClass("active"), a >= this.pane_count && this.pause(), a = Math.max(0, Math.min(a, this.pane_count - 1)), this.$items.eq(a).toggleClass("active"), this.current_pane = a; 
    var b = -(100/this.pane_count * this.current_pane); 
    return this._setContainerOffset(b, !0, a), this 
} 

<a href="http://clustersystems.devrun.com/frontapp/js/bootstrap-touch-carousel-custom.js">Here the JS library</a>