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

[Feat] Add event for when the resize event fires and all changes have been propagated through #61

Open
rvanhoecke opened this issue Aug 3, 2023 · 0 comments

Comments

@rvanhoecke
Copy link

Emitting an event after resize would allow for custom hooks after the slider has been re-initialized. This may require asynchronous methods for the the construction of the slider. I have tried to hook the .next(currentPage) function to return to the same slide after resize as it is a jarring experience for a user to be moved back to slide 1 whenever they resize the page. This could also be solved by allowing the user to specify the starting slide in the config parameters on construction of the slider. An example for the config would be
this.sliderConfig = {
all: {
slidesToShow: 1,
loop: false
startOnSlide: 5
//with this parameter you could pass a function in so the reinit would work as well
get startOnSlide() {
return getCurrentSlide();
},
},
}

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

No branches or pull requests

2 participants