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

8 lines
324 B
JavaScript
Raw Permalink Normal View History

2021-02-11 20:47:42 +00:00
(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)
})()