How to scroll the page, when I have vertical swiper on mobile view #7595
Replies: 1 comment
-
I've struggled with this one for a while as well and the solution I found was honestly pretty hacky but it worked for me. If someone can come up with a cleaner solution feel free to add on to this. I would love to know how this get's done properly. SituationIn my project I had a vertical swiper which I wanted the be usable using external buttons. The user should never be able to slide the swiper directly. The swiper contained articles with a clickable image and button. On mobile when I tried to swipe to scroll it wouldn't scroll if my swipe started on my swiper. What I tried (and didn't work)
None of these helped to solve my issue. (Hacky) SolutionIf you need a vertical slider that the user should never interact with directly then adding If you were in a situation like mine where you needed to be able to click on elements inside the swiper then this what I did.
Considering that a horizontal swiper only prevents horizontal page scrolling, this works perfectly for me as I only needed vertical scrolling on my page. The solution also still allows me to have clickable items inside of my swiper. Clearly this is a very hacky solution, I'm making a horizontal swiper look vertical, but this is what worked for me. Maybe there is a cleaner way of doing this but I certainly couldn't find it. To me, it just seems weird though that setting |
Beta Was this translation helpful? Give feedback.
-
Can someone please give the example how to swipe(scroll the page) when the view is in swiper on mobile view?
Beta Was this translation helpful? Give feedback.
All reactions