DEV Community


Posted on

Stop Flickity from scrolling when swiping

I havent fully tested this, but i think this could be the latest best solution. Give it a go.

// stop page from scrolling when swiping flickity
let scrollY;

flkty.on('dragStart', () => {
  scrollY = window.scrollY;

flkty.on('dragMove', () => {
  window.scrollTo(0, scrollY)
Enter fullscreen mode Exit fullscreen mode

Discussion (0)