I have an issue with – what should be a simple script, not working. I'm gunning to get my personal website up after being laid-off after 7yrs of employment and this is holding up the show.
I cannot get the mobile navigation to work (as a UI developer, not good). Any of you fine Astro wizzards will get my utmost appreciation if you could help. Hopefully the fix is easy.
My repo:
https://github.com/pychap/pyc-site
1st: I've taken the basic code into a (separate), stripped-down sandbox environment and it works as it should!
The JavaScript code is relatively simple.
There are no errors Astro throws.
Console logs aren't logging on button click
.
The JS script is in its own dedicated file (local): scripts/navScript.js
HTML code is in components/Navigation.astro
The JS file is linked in my layouts/Layout.astro file (I tried putting script into component also).
I read the docs on Client-side scripts which seem pretty straight-forward. https://docs.astro.build/en/guides/client-side-scripts/#client-side-scripts
If you pull my repo you'll see a clunky "menu" button in upper left
I have a light/dark theme switcher that uses a relatively simple javascript file, that works fine. Go figure.
I'm not concerned about links, I will fix that, it's getting the menu to dropdown (show) & up (hide) on click.
Again, any help is GREATLY appreciated.