mirror of
https://github.com/Fluffy-Bean/GameExpo23.git
synced 2025-05-20 02:04:52 +00:00
Fix nav height not being updated unless window is resized
This commit is contained in:
parent
85986048da
commit
e6794d42af
5 changed files with 13 additions and 8 deletions
|
@ -7,16 +7,21 @@ window.onscroll = () => {
|
|||
checkSection();
|
||||
};
|
||||
window.onload = () => {
|
||||
scrollFunction()
|
||||
resizeNav();
|
||||
scrollFunction();
|
||||
checkSection();
|
||||
};
|
||||
window.onresize = () => {
|
||||
resizeNav();
|
||||
checkSection();
|
||||
}
|
||||
|
||||
function resizeNav() {
|
||||
if (window.innerWidth > 600) {
|
||||
navSpacing = (3 * 16);
|
||||
} else {
|
||||
navSpacing = (6 * 16);
|
||||
}
|
||||
|
||||
checkSection();
|
||||
}
|
||||
|
||||
function scrollFunction() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue