aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorChristopher Morrissey <[email protected]>2018-09-18 08:55:48 -0400
committerXhmikosR <[email protected]>2018-09-18 15:55:48 +0300
commitea0faadde5c222cdd8127332b62a6d565a055d80 (patch)
tree6292c56e10eb63ae2a8b42491aee6aedbd879504 /js/src
parente6049586413f663ae99ec660d6378306833e2223 (diff)
downloadbootstrap-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.js8
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)