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 Normal View History

2021-02-09 01:03:38 +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)
})()