1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-16 18:44:01 +02:00

feature(carousel): carousel-item interval (#26667)

adds the ability to assign data-interval to an individual carousel-item
This commit is contained in:
Christopher Morrissey
2018-09-18 08:55:48 -04:00
committed by XhmikosR
parent e604958641
commit ea0faadde5
3 changed files with 85 additions and 0 deletions

View File

@@ -385,6 +385,14 @@ const Carousel = (($) => {
$(activeElement).addClass(directionalClassName)
$(nextElement).addClass(directionalClassName)
const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)
if (nextElementInterval) {
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
this._config.interval = nextElementInterval
} else {
this._config.interval = this._config.defaultInterval || this._config.interval
}
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
$(activeElement)