We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71ab0a8 commit 316917bCopy full SHA for 316917b
src/js/01-nav.js
@@ -114,7 +114,13 @@
114
}
115
116
function toggleActive () {
117
- this.classList.toggle('is-active')
+ if (this.classList.toggle('is-active')) {
118
+ var padding = parseFloat(window.getComputedStyle(this).marginTop)
119
+ var rect = this.getBoundingClientRect()
120
+ var menuPanelRect = menuPanel.getBoundingClientRect()
121
+ var overflowY = (rect.bottom - menuPanelRect.top - menuPanelRect.height + padding).toFixed()
122
+ if (overflowY > 0) menuPanel.scrollTop += Math.min((rect.top - menuPanelRect.top - padding).toFixed(), overflowY)
123
+ }
124
125
126
function showNav (e) {
0 commit comments