You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems impossible to scroll an element within a vertical swiper slide since the scroll event is recognized for the wrapper and moves to the next slide. How does one scroll an element within a swiper slide? By disabling scroll event for the wrapper on child element hover perhaps?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It seems impossible to scroll an element within a vertical swiper slide since the scroll event is recognized for the wrapper and moves to the next slide. How does one scroll an element within a swiper slide? By disabling scroll event for the wrapper on child element hover perhaps?
For example:
<title>Swiper demo</title>`
Hello
1
2
3
4
5
6
7
8
9
html, body { position: relative; height: 100%; } body { background: #eee; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #000; margin: 0; padding: 0; } .swiper-container { width: 100%; height: 100%; } .swiper-slide { text-align: center; font-size: 18px; background: #fff; /* Center slide text vertically */ display: -webkit-box; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; -webkit-align-items: center; align-items: center; } .swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; } .mybox { position: relative; top: 5%; width: 50%; margin-left: 5%; } .myscroll { max-height: 120px; overflow: scroll; }
var swiper = new Swiper(".mySwiper", { direction: "vertical", pagination: { el: ".swiper-pagination", clickable: true, }, mousewheel: { enabled: true, sensitivity: .2, thresholdDelta: 50, forceToAxis: true } });
Beta Was this translation helpful? Give feedback.
All reactions