add back removed left sidebar scroll behavior
This commit is contained in:
parent
50f82e1a53
commit
7ad7e16633
1 changed files with 9 additions and 0 deletions
|
@ -21,6 +21,15 @@ const {currentPage} = Astro.props;
|
|||
</ul>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
var target = document.querySelector('.nav-link.is-active');
|
||||
if (target && (target.offsetTop > (window.innerHeight - 100))) {
|
||||
document.querySelector('.nav-groups').scrollTop = target.offsetTop;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
nav {
|
||||
width: 100%;
|
||||
|
|
Loading…
Reference in a new issue