This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/docs/schema/scripts/focus-active.js
2021-02-08 20:03:38 -05:00

8 lines
324 B
JavaScript

(function () {
var navScroll = document.getElementById('navication-scroll');
var header = document.querySelector('nav header');
var active = document.querySelector('.slds-is-active a');
if(active)
navScroll.scrollTop = active.offsetTop - header.offsetHeight - Math.ceil(active.offsetHeight / 2)
})()