diff --git a/js/carousel.js b/js/carousel.js index 6ff954c9bd..2091bc351d 100644 --- a/js/carousel.js +++ b/js/carousel.js @@ -144,7 +144,9 @@ var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) - $next[0].offsetWidth // force reflow + if (typeof $next === 'object' && $next.length) { + $next[0].offsetWidth // force reflow + } $active.addClass(direction) $next.addClass(direction) $active