So I’m pretty pleased with the progress of my personal portfolio site, even if it is taking me forever to do. Of course, I want the fixed navbar to collapse and be toggle-able on smaller screens. At the moment, my navbar is collapsing and the toggle button is appearing. However, nothing happens when I click the hamburger button. I’m sure that my menu items are supposed to appear. I can’t find what’s wrong. I did link the bootstrap css and js files as well as jQuery in the relevant sections of my codepen.
Could somebody please look at this navbar markup and tell me what is wrong? Do I have to somehow activate this with some jQuery/ JavaScript that I write myself or what? From all the tutorials I’ve read or watched it seems like it should work from this markup alone…
It took me ages to try and find a solution… I ended up remembering to go in the freecodecamp chatrooms and just at that moment somebody was telling someone else to load jQuery before Bootstrap. Their problem was not the same as mine, but it made me go and check their codepen. And sure enough, their hamburger button didn’t work either. So I went to my own header file and saw that I too had loaded Bootstrap before jQuery. All I needed to do was switch them around. Phew! What a relief.
I’m so glad there are more advanced people around to help.
wow! I have this same problem. and even after reading this I am not sure what exactly do I need to do.
I have my portfolio on codepen and I am adding the jquery and bootstrap using the settings, but maybe I am still missing something.
could you tell me what exactly do I need to do to make this work?
So what solved it for me is in the JS section of my pen, under the ‘add external javascript’ setting, the very first thing that I add is jQuery from ‘quick-add.’ The second thing to add is bootstrap (also from quick-add.) After that, you can add other optional things like Font Awesome or whatever.
That is different and separate from the CSS section where you also have to quick add bootstrap, if you are using bootstrap css for the layout.
I hope this helps? Otherwise maybe post a link to your pen so we can check exactly where the problem is.
Thank you so much for posting this! I was going crazy trying to figure this out.
BTW for anyone else looking at this, make sure you are using the javascript link for bootstrap and not the CSS link for bootstrap.
I had the exact same problem, except that the whole navbar wouldn’t toggle down on the smaller screen sizes.
Thanks so much for saving me from a major headache as I was starting to get frustrated as to why it wasn’t working! Works perfect now! Many thanks again.