When using fullPage.js in Webflow, there might be a need to disable it on mobile devices. Simply hiding Div Blocks may not work due to its JavaScript behavior. Here's how you can use JavaScript to disable fullPage.js on smaller screens:
<script>
document.addEventListener('DOMContentLoaded', function() {
var widthThreshold = 768; // Define your desired breakpoint
if (window.innerWidth <= widthThreshold) {
if (typeof $.fn.fullpage.destroy === 'function') {
$.fn.fullpage.destroy('all'); // Destroy fullPage.js
}
} else {
$('#fullpage').fullpage(); // Initialize fullPage.js for larger screens
}
});
</script>
To disable fullPage.js on mobile devices in Webflow, implement a script that checks the screen size and calls the .destroy('all') method for smaller screens. Ensure this script is added to the Before </body> tag section and adjust the breakpoint as needed.