2014-09-24 30 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>