[英]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.我正在使用fullpage.js和移动设备,一切都可以拖动并且工作正常,我只需要桌面(我创建的容器)也可以拖动 - 它现在只能滚动。 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.我想知道正在使用的在移动设备上启用可拖动的“东西”是什么,以便我可以复制 css 或其他任何东西。
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.我在移动设备上启用了这个 scrollOverflow 选项。 I tried enabling it on desktop as well but it didn't make a difference.我也尝试在桌面上启用它,但没有任何区别。
const options = {
scrollOverflow: deviceType == 'mobile' ? true : false
}
Oh I think I found the solution.哦,我想我找到了解决方案。
I use the normalScrollElements
option and target the container that I created.我使用normalScrollElements
选项并以我创建的容器为目标。 And it is working fine now.它现在工作正常。 :) :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.