mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 00:24:03 +02:00
fix multi carousel bug #3194
This commit is contained in:
3
docs/assets/js/bootstrap-carousel.js
vendored
3
docs/assets/js/bootstrap-carousel.js
vendored
@@ -144,9 +144,10 @@
|
|||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('carousel')
|
, data = $this.data('carousel')
|
||||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||||
|
, action = typeof option == 'string' ? option : options.slide
|
||||||
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
||||||
if (typeof option == 'number') data.to(option)
|
if (typeof option == 'number') data.to(option)
|
||||||
else if (typeof option == 'string' || (option = options.slide)) data[option]()
|
else if (action) data[action]()
|
||||||
else if (options.interval) data.cycle()
|
else if (options.interval) data.cycle()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
3
docs/assets/js/bootstrap.js
vendored
3
docs/assets/js/bootstrap.js
vendored
@@ -388,9 +388,10 @@
|
|||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('carousel')
|
, data = $this.data('carousel')
|
||||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||||
|
, action = typeof option == 'string' ? option : options.slide
|
||||||
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
||||||
if (typeof option == 'number') data.to(option)
|
if (typeof option == 'number') data.to(option)
|
||||||
else if (typeof option == 'string' || (option = options.slide)) data[option]()
|
else if (action) data[action]()
|
||||||
else if (options.interval) data.cycle()
|
else if (options.interval) data.cycle()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
3
js/bootstrap-carousel.js
vendored
3
js/bootstrap-carousel.js
vendored
@@ -144,9 +144,10 @@
|
|||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
, data = $this.data('carousel')
|
, data = $this.data('carousel')
|
||||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||||
|
, action = typeof option == 'string' ? option : options.slide
|
||||||
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
||||||
if (typeof option == 'number') data.to(option)
|
if (typeof option == 'number') data.to(option)
|
||||||
else if (typeof option == 'string' || (option = options.slide)) data[option]()
|
else if (action) data[action]()
|
||||||
else if (options.interval) data.cycle()
|
else if (options.interval) data.cycle()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user