diff options
| author | Christopher Morrissey <[email protected]> | 2018-09-18 08:55:48 -0400 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2018-09-18 15:55:48 +0300 |
| commit | ea0faadde5c222cdd8127332b62a6d565a055d80 (patch) | |
| tree | 6292c56e10eb63ae2a8b42491aee6aedbd879504 /js/src | |
| parent | e6049586413f663ae99ec660d6378306833e2223 (diff) | |
| download | bootstrap-ea0faadde5c222cdd8127332b62a6d565a055d80.tar.xz bootstrap-ea0faadde5c222cdd8127332b62a6d565a055d80.zip | |
feature(carousel): carousel-item interval (#26667)
adds the ability to assign data-interval to an individual carousel-item
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/carousel.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 2d7ab0d67..610319a6e 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -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) |
