diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-08-17 18:44:09 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2017-08-17 19:48:14 +0300 |
commit | 58b54b6c15543dce3aca90e202037fa3b194f72e (patch) | |
tree | 6b3b0ac8d0c74a6ade4c8961b00e3e4f8b7e1a71 /js/src/carousel.js | |
parent | a77f515a2228a11ae5815a76b7f3ba3b3bd17f1e (diff) |
Carousel - do not call next when the carousel or the parent isn't visible
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r-- | js/src/carousel.js | 4 |
1 files changed, 3 insertions, 1 deletions
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() } } |