mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-03 08:41:59 +02:00
Cache a few variables.
This commit is contained in:
@@ -129,10 +129,11 @@ class Carousel {
|
||||
}
|
||||
|
||||
nextWhenVisible() {
|
||||
const $element = $(this._element)
|
||||
// Don't call next when the page isn't visible
|
||||
// or the carousel or its parent isn't visible
|
||||
if (!document.hidden &&
|
||||
($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {
|
||||
($element.is(':visible') && $element.css('visibility') !== 'hidden')) {
|
||||
this.next()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user