-1

So I used an external script for my web page by

<script src="fullpage.js"></script>

But it disables scrolling on the site. On mobile version (which is completely different) I need to disable the script to make scrolling work. How can I do this?

Miszla
  • 1
  • 1

1 Answers1

1

you need first to detect if the user is browsing from mobile or not so you can use this method

function isMobileDevice() {
    return (typeof window.orientation !== "undefined") || (navigator.userAgent.indexOf('IEMobile') !== -1);
};

then you can wrap your script in the file with an if statement

// inside your fullpage.js file

if (!isMobileDevice()) { // check if it's not a mobile device
    // put your code here
}

I hope this helps :)