/
githubmirror
/
fullPage.js
Обзор
Документация
Войти
/
githubmirror
/
fullPage.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/js/scroll/setAllowScrolling.js
23 строки
816 B
Alvaro Trigo López
- v4 version
16 мар 2022, 21:03
16 мар 2022, 21:03
902c448
Код
Авторство
О чём код?
import { setIsScrollAllowed } from "../common/isScrollAllowed.js"; import { FP } from '../common/constants'; FP.setAllowScrolling = setAllowScrolling; /** * Adds or remove the possibility of scrolling through sections by using the mouse wheel/trackpad or touch gestures. * Optionally a second parameter can be used to specify the direction for which the action will be applied. * * @param directions string containing the direction or directions separated by comma. */ export function setAllowScrolling(value, directions){ if(typeof directions !== 'undefined'){ directions = directions.replace(/ /g,'').split(','); directions.forEach(function (direction){ setIsScrollAllowed(value, direction, 'm'); }); } else{ setIsScrollAllowed(value, 'all', 'm'); } }