Open web-mickey opened 4 years ago
Hi,
- I have application where I have some buttons outside of Swiper component and would like to swipe left or right when I press the button. How can I do it?
- I would like to show something while I am swiping to left or right. I know there is a function "onSwiping" but how can I know that I am swiping left or right to show different text?
Have you find any solution for this please share.
@gauravsbagul @Mikowhy-owl
<Swiper ref={swiper=>{ this.swiper = swiper }}/>
In your <Swiper />
add a reference, and you can use this reference to swipe the card left or right on a button click which is outside the swiper.
To swipe left this.swiper.swipeLeft();
To swipe right this.swiper.swipeRight();
Hi found the solution
<Swiper ref={'swiper'} key={this.state.questions.length} {swiperItems} </Swiper>
and this.refs.swiper.scrollBy(1);
Hi,
I have application where I have some buttons outside of Swiper component and would like to swipe left or right when I press the button. How can I do it?
I would like to show something while I am swiping to left or right. I know there is a function "onSwiping" but how can I know that I am swiping left or right to show different text?