From 58b54b6c15543dce3aca90e202037fa3b194f72e Mon Sep 17 00:00:00 2001 From: Johann-S Date: Thu, 17 Aug 2017 17:44:09 +0200 Subject: Carousel - do not call next when the carousel or the parent isn't visible --- js/src/carousel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/src/carousel.js') 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() } } -- cgit v1.2.3