Skip to content

mousewheel enable on vertical direction after Slider Section Stick on top #4396

Answered by nolimits4web
shankyag asked this question in Q&A
Discussion options

You must be logged in to vote

I think the logic should be the following:

  • listen for scroll event on document (i.e. document.addEventListener('scroll', handler)
  • in event handler check Swiper top offset (i.e. document.querySelector('.swiper-container).getBoundingClientRect().top)
  • if top offset less than its sticky position (for example <= 0 if it bound to top edge) do the swiper.mousewheel.enable()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shankyag
Comment options

Answer selected by shankyag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants