-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(carousel): carousel-item interval #26667
feature(carousel): carousel-item interval #26667
Conversation
js/src/carousel.js
Outdated
@@ -385,6 +385,20 @@ const Carousel = (($) => { | |||
$(activeElement).addClass(directionalClassName) | |||
$(nextElement).addClass(directionalClassName) | |||
|
|||
if ($(nextElement).data('interval')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use more vanilla JS and change that line by
const nextElementInterval = nextElement.getAttribute('data-interval')
if (nextElementInterval) {
js/src/carousel.js
Outdated
{ | ||
interval : '(number|boolean)' | ||
}) | ||
this._config.defautlInterval = this._config.defautlInterval || this._config.interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here, it's not defautlInterval
but defaultInterval
js/src/carousel.js
Outdated
interval : '(number|boolean)' | ||
}) | ||
this._config.defautlInterval = this._config.defautlInterval || this._config.interval | ||
this._config.interval = $(nextElement).data('interval') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here instead of get the value from the dom use nextElementInterval
There are a lots of things to do before we accept this MR :
|
Here is a CodePen displaying this functionality. |
very nice @morrissey-ingenious 👍 I want the feedbacks from other members before merging your PR /CC @XhmikosR, @patrickhlauke, @mdo |
adds the ability to assign data-interval to an individual carousel-item
adds the ability to assign data-interval to an individual carousel-item.
I'm aware this may not be the proper way to add this functionality so please comment and give feedback and suggestions so that I can modify this pull request.
thanks