0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Carousel - do not call next when the carousel or the parent isn't visible

This commit is contained in:
Johann-S 2017-08-17 17:44:09 +02:00
parent a77f515a22
commit 58b54b6c15

View File

@ -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()
}
}