Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable mouse scroll trigger in fullpage.js only

In fullpage.js core functions

How to customize such that when set option autoScrolling: true.

1.only disable mouse scroll behavior trigger in section scrolling control.

2.other keyboard scroll triggers still working. (such as keyup keydown end home etc)

here is the fullpage.js code from git: https://github.com/ajgagnon/fullPage.js/blob/master/jquery.fullPage.js

Explaination: why need to disable mouse scroll sometimes. Because there are scroll sensitivity issues in fullpage.js when "scrollOverflow: true". However, if you totally disabled the "autoScrolling: true" option, by default keyboard trigger still allow to scroll up down left right. ( "keyboardScrolling: true" by default; )

However, I discovered when "scrollOverflow: false" option together with "keyboardScrolling: true", the content will shake instantly the moment you press down the arrow keys. don't know how to fix, so it's my purpose to keep scrollOverflow:true while disable mouse scroll only. then will be no issue. )

like image 925
infiniteloop Avatar asked Dec 02 '14 09:12

infiniteloop


People also ask

How to cancel scroll in CSS?

To disable scroll bars in CSS, you can use “overflow-x”, “overflow-y”, and the “overflow” properties. The overflow-x property is specifically utilized for disabling the vertical scroll bar, and the overflow-y property to disable horizontal scroll bars.


2 Answers

How about:

$(function()
{
    $('#fullpage').fullpage({
        ...
    });

    $.fn.fullpage.setMouseWheelScrolling(false);
    $.fn.fullpage.setAllowScrolling(false);
});
like image 135
Ferret Avatar answered Sep 19 '22 20:09

Ferret


However, if you totally disabled the "autoScrolling: true" option, by default keyboard trigger still allow to scroll up down left right. ( "keyboardScrolling: true" by defa

Not anymore since fullPage.js 2.4.9. autoScrolling:false will disable the auto scroll with keyboard as well.

like image 32
Alvaro Avatar answered Sep 18 '22 20:09

Alvaro