Open SalvatoreMazzullo opened 5 years ago
this is the show() source code ` show(index, force = false) { // If all slides are already visible then return if (!this.state.length || this.state.length <= this.slidesToShow) { return; }
if (typeof index === 'Number') {
this.state.next = index;
}
if (this.options.loop) {
this._loop.apply();
}
if (this.options.infinite) {
this._infinite.apply();
}
// If new slide is already the current one then return
if (this.state.index === this.state.next) {
return;
}
this.emit('before:show', this.state);
this._transitioner.apply(force, this._setHeight.bind(this));
this.emit('after:show', this.state);
this.emit('show', this);
} ` and next() is working.
you need to set index first
https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Operators/typeof
key: 'show',
value: function show(index) {
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; // If all slides are already visible then return
if (!this.state.length || this.state.length <= this.slidesToShow) {
return;
}
if (typeof index === 'Number') {
this.state.next = index;
}
typeof index === 'Number' should be typeof index === 'number'
I'm not sure if will be helpful. But to show a specific slide I did like this
let c = carousels[0]
for(let k of Object.keys(bullet_list) {
bullet_list[k].onclick = function() {
if(c.state.next = k) return;
else {
c.state.next = Number(k);
c.show(k);
}
}
}
As Iribeiro says, there's an error comparing variable type. I see the method is already updated in the repo, but in npm method still using 'Number', at least in version 4.0.4.
Hi, I'm trying to integrate a carousel so that it changes slides at the pressure of a particular link.
this is the javascript
I state that with the code inserted in the documentation I cannot access the desired carousel, having only one I tried to access it as if it were a simple array:
but this not produce no result.
Awaiting your reply, Thank you.