Fullpage.js在移动设备上/给定像素以下禁用? [英] Fullpage.js disable on mobile/below given pixels?

查看:214
本文介绍了Fullpage.js在移动设备上/给定像素以下禁用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://alvarotrigo.com/fullPage/

我已经尝试过像这样的代码,但这很难过.对于移动用户,我想在976px之后禁用它.

I've tried code like this but that doesn't work sadly. I want to disable it after 976px for mobile users.

<script>
if (screen && screen.width > 768) {
document.write('<script type="text/javascript" src="http://your-file-path/fullpage.js"><\/script>');
}
</script>

推荐答案

只需将responsiveWidthresponsiveHeight选项与fp-auto-height-responsive结合使用.

Just use the responsiveWidth or responsiveHeight option combined with fp-auto-height-responsive.

fullPage.js文档中详细了解所有这些选项,或参见此codepen .

Read more about all of those options in the fullPage.js docs or see this codepen.

这篇关于Fullpage.js在移动设备上/给定像素以下禁用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆