Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Morrissey <morrissey@ingenious.org>2018-09-18 15:55:48 +0300
committerXhmikosR <xhmikosr@gmail.com>2018-09-18 15:55:48 +0300
commitea0faadde5c222cdd8127332b62a6d565a055d80 (patch)
tree6292c56e10eb63ae2a8b42491aee6aedbd879504 /js/src/carousel.js
parente6049586413f663ae99ec660d6378306833e2223 (diff)
feature(carousel): carousel-item interval (#26667)
adds the ability to assign data-interval to an individual carousel-item
Diffstat (limited to 'js/src/carousel.js')
-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 2d7ab0d672..610319a6e0 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)