Skip to content
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

when use goToSlide, the last panel will still overlay on the top #126

Open
wenhsiaoyi opened this issue Jan 29, 2019 · 0 comments
Open

when use goToSlide, the last panel will still overlay on the top #126

wenhsiaoyi opened this issue Jan 29, 2019 · 0 comments

Comments

@wenhsiaoyi
Copy link

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');
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant