To disable fullPage.js on mobile view in Webflow, you can add custom JavaScript to your project. This script will check the viewport width and disable fullPage.js when the device width is less than a specified threshold, such as 768 pixels for mobile devices.
<script>
let isFullPageEnabled = true;
const disableFullPage = () => {
if (window.innerWidth < 768 && isFullPageEnabled) {
fullpage_api.destroy('all');
isFullPageEnabled = false;
} else if (window.innerWidth >= 768 && !isFullPageEnabled) {
// Optional: Re-initialize fullPage.js if desired on larger screens
}
};
// Disable fullPage.js on initial load
disableFullPage();
// Add event listener to handle window resizing
window.addEventListener('resize', disableFullPage);
</script>
To disable fullPage.js on mobile views in Webflow, add a JavaScript script to your project that checks the viewport width and destroys the fullPage.js instance if the device is mobile-sized. This approach effectively prevents fullPage.js from running on smaller screens.