Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-03-20 02:48:57 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-03-20 02:48:57 +0400
commit67f199678c6f764f2812260f42b553b22ec740f8 (patch)
tree50d0b85cede5029579fa2ed86d89546367c6b80c /docs/assets/js/bootstrap-carousel.js
parent83a7a698939b5b4cba3c04a86befc12b9005df3d (diff)
if interval is false, do not autocycle the carousel
Diffstat (limited to 'docs/assets/js/bootstrap-carousel.js')
-rw-r--r--docs/assets/js/bootstrap-carousel.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/docs/assets/js/bootstrap-carousel.js b/docs/assets/js/bootstrap-carousel.js
index 8c0723d280..2875199005 100644
--- a/docs/assets/js/bootstrap-carousel.js
+++ b/docs/assets/js/bootstrap-carousel.js
@@ -27,7 +27,7 @@
var Carousel = function (element, options) {
this.$element = $(element)
- this.options = $.extend({}, $.fn.carousel.defaults, options)
+ this.options = options
this.options.slide && this.slide(this.options.slide)
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
@@ -37,7 +37,8 @@
Carousel.prototype = {
cycle: function () {
- this.interval = setInterval($.proxy(this.next, this), this.options.interval)
+ this.options.interval
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
@@ -129,11 +130,11 @@
return this.each(function () {
var $this = $(this)
, data = $this.data('carousel')
- , options = typeof option == 'object' && option
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (typeof option == 'string' || (option = options.slide)) data[option]()
- else data.cycle()
+ else if (options.interval) data.cycle()
})
}