diff options
| author | Gijs Boddeus <[email protected]> | 2017-08-25 23:29:40 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-08-25 23:29:40 +0200 |
| commit | 4356d08abb4d94785af15f3cc9be0e553f1c1c03 (patch) | |
| tree | ce649fd410b7e9a38758ef8318e1d9aba5eef3e8 /js/src/carousel.js | |
| parent | a103958975787653b4ba84f80d1d1e8f7be302c3 (diff) | |
| parent | ba6a6f13691000ffaf22ef8e731513737659447f (diff) | |
| download | bootstrap-4356d08abb4d94785af15f3cc9be0e553f1c1c03.tar.xz bootstrap-4356d08abb4d94785af15f3cc9be0e553f1c1c03.zip | |
Merge pull request #3 from twbs/v4-dev
update from official repo
Diffstat (limited to 'js/src/carousel.js')
| -rw-r--r-- | js/src/carousel.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index a5d5f143a..873660519 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 its parent isn't visible + if (!document.hidden && + ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) { this.next() } } @@ -441,7 +443,7 @@ const Carousel = (($) => { if (typeof config === 'number') { data.to(config) } else if (typeof action === 'string') { - if (data[action] === undefined) { + if (typeof data[action] === 'undefined') { throw new Error(`No method named "${action}"`) } data[action]() |
