JavaScript - How to Create a Responsive Hamburger Menu with HTML, CSS, & JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ส.ค. 2021
  • In this tutorial, you'll learn how to create a responsive hamburger menu using HTML, CSS and JavaScript.
    Sponsor me on GitHub!
    github.com/sponsors/miguelznunez
    Follow my blog:
    / miguelznunez
    Email : mignunez@csumb.edu
    Medium : / miguelznunez
    Codepen : codepen.io/miguelznunez
    GitHub : github.com/miguelznunez

ความคิดเห็น • 310

  • @mary-hu3ff
    @mary-hu3ff 2 ปีที่แล้ว +51

    One of the best tutorials I have seen up until now in JS for a simple dynamic!
    Even tho it's a simple topic, some people over complicate their tutorials so much, thank you!!!

  • @evelyntelevision
    @evelyntelevision ปีที่แล้ว +7

    Thanks for this! I searched all over for a simple, straightforward tutorial on making a collapsing navbar/hamburger menu like this, and yours is the best! I appreciate you getting straight to the point.

    • @jessicalopez6121
      @jessicalopez6121 4 หลายเดือนก่อน

      😅😅😅😅😅😅😅

  • @adam3720
    @adam3720 ปีที่แล้ว +50

    In case anyone encounters an error with the JavaScript code not working, remove the script tag inside the tag and add it inside the body right before the tag. That way, the javascript code will be executed after the HTML Document has fully loaded. Your welcome!

    • @baazigar5
      @baazigar5 ปีที่แล้ว +3

      Just use "defer"

    • @inakristinethoresen1003
      @inakristinethoresen1003 ปีที่แล้ว

      Yup, that fixed my problem! Thank you!

    • @trillionairemania7750
      @trillionairemania7750 ปีที่แล้ว

      hey bro in my case its not working . can u help me with that

    • @trillionairemania7750
      @trillionairemania7750 ปีที่แล้ว

      @@baazigar5 hey bro in my case its not working . can u help me with that

    • @baazigar5
      @baazigar5 ปีที่แล้ว

      @@trillionairemania7750check your js file name

  • @thetr8r469
    @thetr8r469 6 หลายเดือนก่อน +1

    Genuinely a really big help for my website. I had put off making a popup menu for so long because the last explanation I saw made my head spin. This was easy to digest and easily customizable. Big thanks.

  • @teenytinytoons
    @teenytinytoons ปีที่แล้ว +8

    Literally the best hamburger tutorial out there hands down. Took me forever to find one where I could understand. Bravo!!

    • @tmm476
      @tmm476 หลายเดือนก่อน

      stfu its not

  • @nkanganthony9794
    @nkanganthony9794 11 หลายเดือนก่อน +2

    You have got some way to deliver what no one else can in my many years or self learning. Thank you so much.

  • @naidenlambev4929
    @naidenlambev4929 2 ปีที่แล้ว +27

    Hello and thank you ! This has helped me a lot. By far the cleanest tutorial and the best explanation. Thank you for giving us such a powerful content. Cant wait to see more from you !

    • @edwardwilson4272
      @edwardwilson4272 2 ปีที่แล้ว

      I agree, I've looked at a few others and this is the best one so far. Really useful JS concepts in here too. Thanks Codefoxx!

  • @Coco-ii2pu
    @Coco-ii2pu ปีที่แล้ว +1

    Thank you sooo much. Been troubling myself with bootstrap all this while when I could have just made mine. This tutorial helped a lot ❤️

  • @sorane8910
    @sorane8910 11 หลายเดือนก่อน

    You don't know how much pain I had to make that thing work, and it never worked until I discover this video.
    Thank you a lot.

  • @rulleywanjau6498
    @rulleywanjau6498 2 ปีที่แล้ว +3

    Thanks these has been a very educative tutorial,has helped me as a student doing computer science ,simple brief and direct to the point

  • @JhonnyBueno
    @JhonnyBueno 2 ปีที่แล้ว

    My guy, you helped me a lot in javascript, I had a problem with my Responsive Menu, I thank you immensely, because I solved my case, congratulations for the video.

  • @ashwinsaxena4734
    @ashwinsaxena4734 หลายเดือนก่อน

    The best video to make a responsive nav bar. Thanks for the video!

  • @sabrinashamsiddinova7691
    @sabrinashamsiddinova7691 ปีที่แล้ว +1

    Best easy responsive menu tutorial I found after scrolling thro internet for an hour

  • @JC-hb2ob
    @JC-hb2ob 2 ปีที่แล้ว +3

    Thank you very much for this tutorial. I am a beginner and it was really well explained which makes it easier to understand.

  • @mrahmancad
    @mrahmancad 2 ปีที่แล้ว

    Thank you very much. I was struggling to make my navbar responsive, your video has helped me a lot. It was very easy to follow.

  • @joshuamichael845
    @joshuamichael845 ปีที่แล้ว

    I've learnt alot since I subscribed to this channel, your videos are always comprehensive and precise.

  • @vendettamalize7209
    @vendettamalize7209 2 ปีที่แล้ว +2

    Thanks you saved my life from hamburger hell, from now on you're my master you have my subscription.

  • @urosmalic7818
    @urosmalic7818 2 ปีที่แล้ว +2

    This with hamburger and adding spans blew my mind till now i was just adding font awesome icons, this sure teaches u that you can do awesome things with only basics

    • @T25de
      @T25de 2 ปีที่แล้ว

      very true

  • @tomcox8801
    @tomcox8801 ปีที่แล้ว +1

    This was a great tutorial. I was looking for a simple way to add a hamburger menu and this was perfect. Nice and simple and clean. Thank you.

    • @codefoxx
      @codefoxx  ปีที่แล้ว

      Absolutely

  • @akshaykhatri2027
    @akshaykhatri2027 2 ปีที่แล้ว +3

    Probably one of the best 😂 stuff, the way you turned hamburger into cross. Appreciable 🌸✨👍

  • @kunoichikun
    @kunoichikun 2 ปีที่แล้ว +1

    thankyou! was able to incorporate into my existing code easy and now everything looks so much cleaner to what i was doing before!

    • @codefoxx
      @codefoxx  2 ปีที่แล้ว +1

      No problem, I got you

  • @KozenDGray
    @KozenDGray 2 ปีที่แล้ว +1

    Yo man great tutorial, best one i've found so far.

  • @rakibhasan9401
    @rakibhasan9401 2 ปีที่แล้ว

    Thanks man! I appreciate your all the efforts buddy! you cracked complicated matters in the simplest way. #respect

  • @premierleaguematches4307
    @premierleaguematches4307 2 ปีที่แล้ว

    The best js tutorial that i have ever seen, thanks bro.

  • @elvirakopstala6519
    @elvirakopstala6519 2 ปีที่แล้ว +2

    Thank you! This was super helpful.

  • @trevormadden4301
    @trevormadden4301 2 ปีที่แล้ว +1

    Cheers man. Nicely put

  • @giulia6930
    @giulia6930 4 หลายเดือนก่อน

    Thank you, clear and step by step explanation. I was looking for this!❤❤

  • @henriquepinheiroxavier
    @henriquepinheiroxavier 2 ปีที่แล้ว

    Thank you very much. Your video was the only one that I understood. I spent my entire weekend trying to learn this menu burger and could not understand it. Your video taught me!

    • @codefoxx
      @codefoxx  2 ปีที่แล้ว

      Anytime, im glad i could help

  • @leroymokobi2928
    @leroymokobi2928 10 หลายเดือนก่อน

    Very simple, clear and straight forward. Yhanks a lot

  • @user-ch9ep2ol9r
    @user-ch9ep2ol9r 11 หลายเดือนก่อน

    Thank you so much for a brilliant tutorial!

  • @hannahsaseun2381
    @hannahsaseun2381 ปีที่แล้ว +1

    this was really helpful. thank you for making it so simple for me

  • @ocel1416
    @ocel1416 2 ปีที่แล้ว

    Great tutorial! You help me so much. This tutorial was it what i needed.

  • @martienvliet8812
    @martienvliet8812 2 ปีที่แล้ว +1

    tysm, this helped me so much, cool vid bro keep up the good work

  • @sayantandey4708
    @sayantandey4708 2 ปีที่แล้ว +1

    Making the cross was dope ...
    You deserve more subscriber...

  • @nnejiben
    @nnejiben ปีที่แล้ว

    This video is awesome and so helpful! Little wonder it came tops in my search result.

  • @jamesdeske4327
    @jamesdeske4327 ปีที่แล้ว

    Of the 1 million Menu tutorials I have seen this is the BEST

  • @wawananggana5129
    @wawananggana5129 2 ปีที่แล้ว

    Simple and straight tutorial.. thank you..

  • @roberttanasie5943
    @roberttanasie5943 2 ปีที่แล้ว

    Hello, you have an excellent way of explaining and your videos are on point and easy to understand !!!

  • @prashantmishra5691
    @prashantmishra5691 3 หลายเดือนก่อน

    Great stuff. Subbed!

  • @dktk7
    @dktk7 2 ปีที่แล้ว +1

    Thank You, this tutorial was so easy to understand. 😁

  • @kzhang3835
    @kzhang3835 3 หลายเดือนก่อน

    Thank you so much. This really works. 👍

  • @eliasmailosson9547
    @eliasmailosson9547 2 ปีที่แล้ว

    Such a good video man, Thank you!

  • @obadayahya6176
    @obadayahya6176 8 หลายเดือนก่อน

    Thanks man !!! , your video was awesome keep up the good work

  • @3reinaldo
    @3reinaldo ปีที่แล้ว

    Easy, and clean, thanks its a great tutorial

  • @_heyise
    @_heyise 9 หลายเดือนก่อน

    This is very helpful. Thank you for this!!

  • @klaasjanssen644
    @klaasjanssen644 2 ปีที่แล้ว

    beautiful smooth menu, great job! thx for this video

    • @codefoxx
      @codefoxx  2 ปีที่แล้ว

      Absolutely!

  • @mahdigholami3916
    @mahdigholami3916 ปีที่แล้ว +1

    Greet tutorial, simple and clear.. many thanks for what you are doing man!

    • @codefoxx
      @codefoxx  ปีที่แล้ว

      I appreciate it 🙏

  • @goergops9593
    @goergops9593 2 ปีที่แล้ว

    Awesome tut, thanks a lot man

  • @simasgradeckas4259
    @simasgradeckas4259 2 ปีที่แล้ว +3

    Super clear & brief tutorial - thanks a lot!

  • @Rain_berries
    @Rain_berries 2 ปีที่แล้ว +1

    Man thank you so much. this has really helped me. ❤

  • @superrnaah
    @superrnaah ปีที่แล้ว

    was trying to figure out the js to close the hamburger on link click and found it in this video. Thank you!

  • @ff0x
    @ff0x 2 ปีที่แล้ว

    Thankyou so much for this. You've earned another subscriber - great video :)

  • @NiceChange
    @NiceChange 8 หลายเดือนก่อน

    Thus is some great resources. Great work!!!!

  • @hamzanakan629
    @hamzanakan629 2 ปีที่แล้ว +1

    thanks for this tutorial, it helps me a lot

  • @xanny3690
    @xanny3690 2 ปีที่แล้ว +1

    Good tutorial man 🖤

  • @photoinshot1355
    @photoinshot1355 7 หลายเดือนก่อน

    Great video, well explained and demonstrated, easy to follow understand and implement because the tutorial is so well presented. Thanks! Was a great help.

  • @hajarahmed304
    @hajarahmed304 10 หลายเดือนก่อน

    thank you so much! this helped a lot

  • @ravitejadarla3882
    @ravitejadarla3882 ปีที่แล้ว

    I ever seen this kind of clean explation video you made my day, but only thing we need to look into it when we have menu-links than we unable to scroll up & down I request you to check that please make a video on huge menu navigation bar sir....

  • @fannienatourz
    @fannienatourz ปีที่แล้ว

    Thank you so much for this tutorial!
    This was a life saver. Trust me!😅

  • @enssahfayiamomoh8410
    @enssahfayiamomoh8410 ปีที่แล้ว

    This video is very insightful... thank you a lot...I have learned so much from the video

  • @Justhue
    @Justhue 8 หลายเดือนก่อน

    Thank you this is so helpful

  • @theshelbypalace
    @theshelbypalace 11 หลายเดือนก่อน

    this is great video! thank you sooooo much!

  • @promiseuka
    @promiseuka 2 ปีที่แล้ว

    Wow, this is an amazing tutorial

  • @mcpeko5773
    @mcpeko5773 11 หลายเดือนก่อน

    Great stuff. Subscribed. 🍻

  • @vagabondideas9685
    @vagabondideas9685 ปีที่แล้ว

    Excellent! Thank-you

  • @deeeera
    @deeeera 2 ปีที่แล้ว +1

    Wow. It could be this easy? Thank you so much. New subscriber here.

  • @MrOrganicz
    @MrOrganicz ปีที่แล้ว

    Great Video! This really helped me a lot!

  • @LightJackKirin
    @LightJackKirin ปีที่แล้ว

    Splendid video!! Kudos to you mahn. 😮😅

  • @Aalii6
    @Aalii6 ปีที่แล้ว

    very helpful, thank you!

  • @andreapretorius873
    @andreapretorius873 ปีที่แล้ว

    This is so amazing, thank you so much. It was so easy to follow and understand what you were doing.

    • @lazy-hero.
      @lazy-hero. ปีที่แล้ว

      Is it working?

    • @arthurradium5823
      @arthurradium5823 ปีที่แล้ว

      @@lazy-hero. it doesnt work for me... (yes i inserted the script link at end of the body) . nav-menu dont appear after clicking on the burger!

  • @jagannathps
    @jagannathps ปีที่แล้ว

    If i saw this video earlier it could have saved a lot of time

  • @aminul.islam.
    @aminul.islam. 5 หลายเดือนก่อน

    amazing. thank you

  • @spiritualforce
    @spiritualforce ปีที่แล้ว

    Damn! You made this look a cake wake for us. New subscriber bro!!

  • @jaysworldtv4472
    @jaysworldtv4472 2 ปีที่แล้ว

    Thank you so much for this information 💯🙏

  • @gatocode316
    @gatocode316 2 ปีที่แล้ว

    looks awesome!

  • @giulia6930
    @giulia6930 8 หลายเดือนก่อน

    thanks, you enlighted me. it's really hard to find a clear explanation.

  • @JimKernix
    @JimKernix 2 ปีที่แล้ว

    Excellent!

  • @kiimkeophukdee8031
    @kiimkeophukdee8031 ปีที่แล้ว +1

    You've just save my life!!!

  • @bLitzKinG20
    @bLitzKinG20 ปีที่แล้ว

    Thanks bro! Liked & Subbed.

  • @jamesenrique648
    @jamesenrique648 2 ปีที่แล้ว

    Wow, it works!
    Gracias✌

  • @muhammadakram1701
    @muhammadakram1701 2 หลายเดือนก่อน

    The best tutorial

  • @graybab
    @graybab ปีที่แล้ว

    You are a lifesaver

  • @daniellozano6908
    @daniellozano6908 9 หลายเดือนก่อน

    excellent ! thank you!

  • @jakob6123
    @jakob6123 ปีที่แล้ว

    Solid tutorial

  • @user-zw6fx5ro4y
    @user-zw6fx5ro4y 2 ปีที่แล้ว +1

    Hi, thank you very much! This video really helped me!!!!

    • @codefoxx
      @codefoxx  2 ปีที่แล้ว

      I got you

  • @Bigkcee
    @Bigkcee ปีที่แล้ว

    Thanks for the video it really was helpful

  • @GabbyBrucebru
    @GabbyBrucebru 2 ปีที่แล้ว

    Thanks for your tutorial it help me

  • @ZikreMustafaSAW
    @ZikreMustafaSAW ปีที่แล้ว

    Smart work

  • @myclassroom1649
    @myclassroom1649 2 ปีที่แล้ว

    Thanks you so much you made my day

  • @BryantCobarrubias
    @BryantCobarrubias 2 ปีที่แล้ว +2

    Great demo. I adapted this for my react site. Adding comment to boost your YT algorithm. :)

    • @codefoxx
      @codefoxx  2 ปีที่แล้ว

      Awesome and than you

    • @T25de
      @T25de 2 ปีที่แล้ว

      boost boost

  • @adrianCoding
    @adrianCoding ปีที่แล้ว

    Thanks good tutorial

  • @lil-gen
    @lil-gen ปีที่แล้ว +1

    Thank u sooooo much !!!

  • @PRINCEDAKSHWEB_WIZARD
    @PRINCEDAKSHWEB_WIZARD 8 หลายเดือนก่อน

    Thank you bro

  • @MrBrady95
    @MrBrady95 ปีที่แล้ว +1

    Awesome, thanks! Liked and subscribed!

  • @edbarr1379
    @edbarr1379 ปีที่แล้ว

    With the JS file I had to change nav-Menu class to navMenu for the mobile menu to work, and for the class .navbar, use justify-content: space-around, worked best for me to avoid adding padding. Overall great Vid, helped me to get my boiler plate with nav included, now I just change the CSS variables to modify the colors.

  • @JoseMedina-in6ji
    @JoseMedina-in6ji 7 หลายเดือนก่อน

    I just want to say that you are the shit!! Keep it up brother, you'll definitely grow on TH-cam doing this stuff, good voice, right pace, great and simple coding (no homo). I rarely comment. and even less subscribe! You earned the subscribe hands-down. I Look forward to seeing more content.
    funny story, I spent 30 minutes trying to figure out why JavaScript wasn't working (first time with JS), just to realize that my dumbass didn't do the hamburger class on html, SMH.
    peace!🤙

  • @abdelrhmanhussein6759
    @abdelrhmanhussein6759 2 ปีที่แล้ว +1

    Beast!

  • @spicydoge3847
    @spicydoge3847 ปีที่แล้ว +1

    Great video. With some modifications to the code you presented in the video I was able to make a responsive dropdown style menu.

    • @andersrammbraten5708
      @andersrammbraten5708 11 หลายเดือนก่อน +1

      what kind of modifications, if you would like to share? mine's not working

    • @francescaivonnetipianiolor7988
      @francescaivonnetipianiolor7988 8 หลายเดือนก่อน

      mine's not working too :( @@andersrammbraten5708

  • @user-ty5pd4xw2y
    @user-ty5pd4xw2y 2 ปีที่แล้ว +1

    It was perfect))

  • @seand6906
    @seand6906 ปีที่แล้ว

    Bravo!