From: Johann-S Date: Thu, 17 Aug 2017 15:44:09 +0000 (+0200) Subject: Carousel - do not call next when the carousel or the parent isn't visible X-Git-Tag: v4.0.0-beta.2~359 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58b54b6c15543dce3aca90e202037fa3b194f72e;p=thirdparty%2Fbootstrap.git Carousel - do not call next when the carousel or the parent isn't visible --- diff --git a/js/src/carousel.js b/js/src/carousel.js index a5d5f143a4..27a8f7d3b8 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -131,7 +131,9 @@ const Carousel = (($) => { nextWhenVisible() { // Don't call next when the page isn't visible - if (!document.hidden) { + // or the carousel or it's parent isn't visible + if (!document.hidden && + ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) { this.next() } }