nativescript-slides
nativescript-slides copied to clipboard
when use goToSlide, the last panel will still overlay on the top
add previousSlide.panel.translateX = 0 to fix the previousSlide to the reset position .
public goToSlide(index: number): void { if ( this._slideMap && this._slideMap.length > 0 && index < this._slideMap.length ) { let previousSlide = this.currentPanel; // fix right translateX value previousSlide.panel.translateX = 0; this.setupPanel(this._slideMap[index]);
this.notify({
eventName: SlideContainer.changedEvent,
object: this,
eventData: {
direction: direction.none,
newIndex: this.currentPanel.index,
oldIndex: previousSlide.index
}
});
} else {
// console.log('invalid index');
}
}