aboutsummaryrefslogtreecommitdiff
path: root/js/carousel.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-06-08 11:19:35 -0700
committerMark Otto <[email protected]>2014-06-08 11:19:35 -0700
commit34891de173f1ea1dfd470d4cdeed52f83d9a253b (patch)
treea7cb7aaf85bdfce5e1f0a8165879193c327179b6 /js/carousel.js
parentd66b65ddde1b2f1a5cb14f601d30c552c79d7626 (diff)
parent1e3b93804fa88d247d8708529fb44b28d73fd91f (diff)
downloadbootstrap-34891de173f1ea1dfd470d4cdeed52f83d9a253b.tar.xz
bootstrap-34891de173f1ea1dfd470d4cdeed52f83d9a253b.zip
grunt
Diffstat (limited to 'js/carousel.js')
-rw-r--r--js/carousel.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/js/carousel.js b/js/carousel.js
index 2a94a9838..e2cb67a5e 100644
--- a/js/carousel.js
+++ b/js/carousel.js
@@ -36,7 +36,7 @@
wrap: true
}
- Carousel.prototype.cycle = function (e) {
+ Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
@@ -103,10 +103,13 @@
$next = this.$element.find('.item')[fallback]()
}
- if ($next.hasClass('active')) return this.sliding = false
+ if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]
- var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction })
+ var slideEvent = $.Event('slide.bs.carousel', {
+ relatedTarget: relatedTarget,
+ direction: direction
+ })
this.$element.trigger(slideEvent)
if (slideEvent.isDefaultPrevented()) return
@@ -133,7 +136,9 @@
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
- setTimeout(function () { that.$element.trigger(slidEvent) }, 0)
+ setTimeout(function () {
+ that.$element.trigger(slidEvent)
+ }, 0)
})
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
} else {
@@ -185,7 +190,8 @@
// =================
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
- var $this = $(this), href
+ var href
+ var $this = $(this)
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
@@ -193,7 +199,7 @@
Plugin.call($target, options)
- if (slideIndex = $this.attr('data-slide-to')) {
+ if (slideIndex) {
$target.data('bs.carousel').to(slideIndex)
}