/
githubmirror
/
fullPage.js
Обзор
Документация
Войти
/
githubmirror
/
fullPage.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/js/menu/activateMenuAndNav.js
29 строк
866 B
Alvaro Trigo López
- Update
27 мар 2022, 18:28
27 мар 2022, 18:28
cd81f3c
Код
Авторство
О чём код?
import * as utils from '../common/utils.js'; import { getOptions } from '../common/options.js'; import { activateNavDots } from '../nav/sections.js'; import { ACTIVE, ACTIVE_SEL, } from '../common/selectors.js'; /** * Sets to active the current menu and vertical nav items. */ export function activateMenuAndNav(anchor, index){ activateMenuElement(anchor); activateNavDots(anchor, index); } /** * Activating the website main menu elements according to the given slide name. */ function activateMenuElement(name){ if(getOptions().menu && getOptions().menu.length){ utils.$(getOptions().menu).forEach(function(menu) { if(menu != null){ utils.removeClass(utils.$(ACTIVE_SEL, menu), ACTIVE); utils.addClass(utils.$('[data-menuanchor="'+name+'"]', menu), ACTIVE); } }); } }