alvarotrigo / fullPage.js

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple
http://alvarotrigo.com/fullPage/
GNU General Public License v3.0
35.24k stars 7.31k forks source link

Disable touch gesture (only) #2767

Closed SlavisPL closed 7 years ago

SlavisPL commented 7 years ago

Hi, Is any way to disable only touch gesture in section with normal scroll? I need to allow user scrolling only by mouse wheel.

alvarotrigo commented 7 years ago

in section with normal scroll

You mean, with scrollOverflow:true? Or with normalScrollElements?

SlavisPL commented 7 years ago

With scrollOverflow

alvarotrigo commented 7 years ago

fullPage.js doesn't provide any option to do so. But take a look to the iScroll.js docs (vendor library used when using scrollOverflow:true) to see if you find anythign to accomplish that and then pass it to the scrollOverflowOptions option in fullPage.js.

SlavisPL commented 7 years ago

Thank you for your respond. Just one question - I need to initialize iScroll or only scrollOverflowOption: "disableTouch: true"?

alvarotrigo commented 7 years ago

As can be seen on the source code the default fullPage.js options for iScroll.js are the following:

    // Default options for iScroll.js used when using scrollOverflow
    var iscrollOptions = {
        scrollbars: true,
        mouseWheel: true,
        hideScrollbars: false,
        fadeScrollbars: false,
        disableMouse: true,
        interactiveScrollbars: true
    };

They are passed in this way to the scrollOverflowOptions option:

scrollOverflowOptions: {
        scrollbars: true,
        mouseWheel: true,
        hideScrollbars: false,
        fadeScrollbars: false,
        disableMouse: true,
        interactiveScrollbars: true
    }

You would have to pass them in the same way. As an object of options in the scrollOverflowOptions option.

scrollOverflowOptions: {
     disableTouch: true
}

The default ones will be added by fullPage.js.