Search code examples
overflowdraggablefullpage.jsscrollable

fullpage.js make it draggable on desktop / mobile horizontal


I am using fullpage.js and on mobile, everything is draggable and works fine, I just need the desktop (a container that I created) to be draggable as well - it is only scrollable now. I need this because on mobile horizontal view, the container cannot be dragged/moved around.

I would like to know what is the "thing" that is being used that enabled draggable on mobile so that I can copy the css or whatever over.

I know that there are plenty of draggable libraries out there but I really wanna do this the conventional way, without any extra libraries.

I have this scrollOverflow option enabled on mobile. I tried enabling it on desktop as well but it didn't make a difference.

const options = {
    scrollOverflow: deviceType == 'mobile' ? true : false
}

Solution

  • Oh I think I found the solution.

    I use the normalScrollElements option and target the container that I created. And it is working fine now. :)