diff options
| author | Johann-S <[email protected]> | 2017-08-17 17:44:09 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-08-17 17:48:14 +0100 |
| commit | 58b54b6c15543dce3aca90e202037fa3b194f72e (patch) | |
| tree | 6b3b0ac8d0c74a6ade4c8961b00e3e4f8b7e1a71 | |
| parent | a77f515a2228a11ae5815a76b7f3ba3b3bd17f1e (diff) | |
| download | bootstrap-58b54b6c15543dce3aca90e202037fa3b194f72e.tar.xz bootstrap-58b54b6c15543dce3aca90e202037fa3b194f72e.zip | |
Carousel - do not call next when the carousel or the parent isn't visible
| -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 a5d5f143a..27a8f7d3b 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() } } |
