Build a Slide out Hamburger Menu with HTML, CSS & JavaScript

Поделиться
HTML-код
  • Опубликовано: 14 янв 2021
  • Learn how to build a slide-out hamburger menu using HTML, CSS and JavaScript. We utilise the previous video code and implement the new slide out navigation menu and hamburger button to create a fully working mobile navigation menu.
    Previous Video: • Build a Responsive SPA...
    Source Code: github.com/TylerPottsDev/SPA-...
    // JOIN MY DISCORD
    / discord
    // Support me on Ko-Fi
    ko-fi.com/tylerpotts
    // FOLLOW ME ON TWITTER
    / tyler_potts_
    // BECOME A MEMBER
    ruclips.net/user/tylerpottsjoin
    // MY GEAR FOR CODING AND RUclips
    Blue Yeti Microphone: amzn.to/3jr3l7T
    Microphone Stand: amzn.to/35B9LMN
    Chair: amzn.to/3dWds3F
    Thunderbolt Dock: amzn.to/3osBF6u
    Monitor: amzn.to/37I8KoR
    All of these products I own and have tested!
    // INTERESTED IN GAME DEV?
    Game development channel: / muddywolf
    // CHECK OUT MY GAME
    play.google.com/store/apps/de...
    // DO THESE SIMPLE STEPS
    LIKE, SUBSCRIBE & SHARE

Комментарии • 109

  • @wiNtersPista
    @wiNtersPista 2 года назад +2

    Dude, best tutorial in responsive navbars!

  • @utkarshverma3314
    @utkarshverma3314 Год назад +5

    by far the best and the most simplest way of creating a slide-out nav menu thank you so so much!!!

  • @johnnydeymisson1842
    @johnnydeymisson1842 3 года назад +1

    Thank you tylerr,
    hugs from Brazil ♥

  • @asafrushiti5913
    @asafrushiti5913 2 года назад +3

    One of the best tutorial I found in YT

  • @catiaoliveira6843
    @catiaoliveira6843 2 года назад +6

    Tanks for your tutorial, you saved my life at 2 a.m, just a few hours before my presentation for a jury school 🎉 😍 👏🏼

  • @knwr
    @knwr Год назад +16

    Very nice video. I looked around at a few and decided on this one to follow.
    Word of advice: when transforming the hamburger to an 'X', the translate operation is tough to work with because you are calling it after the rotation, so the translation axis rotates as well. These functions work in sequence, so it is easier and better results are achieved if you call the 'translate()' function first. The resulting code is simpler as well:
    .hamburger.is-active, .hamburger:before {
    transform: translate(0px, 11px) rotate(-45deg) ;
    }
    .hamburger.is-active, .hamburger:after {
    transform: translate(0px, -11px) rotate(45deg) ;
    }

  • @sh9vch9nk0
    @sh9vch9nk0 10 месяцев назад

    Thank you for this video, helped me a lot! Very useful and clear explanation 👍🤓

  • @hardwired89
    @hardwired89 3 года назад +1

    Thank you tylerr ,❤️❤️❤️ this javascript features

  • @mooseydev
    @mooseydev Год назад +2

    Concise. Thank you!

  • @burgasdragonheirsilentgods
    @burgasdragonheirsilentgods 3 года назад +2

    Very nice video and example ! Great work and presentation again !

  • @getsturdy
    @getsturdy 2 года назад +6

    Me: writes down code
    Him: "no, actually im gonna...."
    Me: deletes the code

  • @randommosta2489
    @randommosta2489 2 года назад +1

    100% clean operation

  • @aleksandarrasic4204
    @aleksandarrasic4204 Год назад +1

    GOSHHHHH u r amazing my friend. Well done !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @Blue_Pumpkin
    @Blue_Pumpkin 5 месяцев назад

    Thank you. So easy to do.

  • @I1Ido.
    @I1Ido. Год назад +7

    actually you can't hover in mobile but you can by clicking it.

  • @felixsowah8209
    @felixsowah8209 Год назад +1

    Thank you very much.👍 great work

  • @user-yp1su8ye6z
    @user-yp1su8ye6z 4 месяца назад

    Thank you for this ! :)

  • @ObjectiveRealityIsKing
    @ObjectiveRealityIsKing 5 месяцев назад

    Great video, thanks for sharing

  • @I1Ido.
    @I1Ido. Год назад +1

    i recommend using font-awesome for the bars!

  • @priyadharshinimuthukumar8970
    @priyadharshinimuthukumar8970 7 месяцев назад

    Thanks a lot sir...its really helped me to develop my website

  • @otepbergenovamadina6285
    @otepbergenovamadina6285 3 года назад

    thank you) this is awesome))

  • @vinzanity68
    @vinzanity68 6 месяцев назад +1

    fascinating. thank you!

    • @TylerPotts
      @TylerPotts  5 месяцев назад

      Glad you enjoyed it!

  • @skolotoi4588
    @skolotoi4588 Год назад +2

    awesome !! thank you

  • @minademian
    @minademian Год назад

    Great video, thanks!

  • @whyisthiscodenotworking
    @whyisthiscodenotworking 6 месяцев назад +1

    thanks ! for the video loved it

    • @TylerPotts
      @TylerPotts  5 месяцев назад

      Glad you liked it!

  • @mareksamofal3929
    @mareksamofal3929 4 месяца назад

    thank you!

  • @stvnk1m
    @stvnk1m Год назад

    Thanks for tip!

  • @bl7937
    @bl7937 2 года назад +2

    Thank you for the tutorial. I'm a bit confused though as to why you would create a secondary nav tag below the header tag. Look at video time line 9:15. Can you explain why you did it that way?

  • @lance740
    @lance740 9 месяцев назад

    Great video

  • @nox2sweet
    @nox2sweet Год назад

    Thanks!

  • @CaddekPhotos
    @CaddekPhotos 5 месяцев назад

    Question: How come my values on translates differs from yours? Does that have to do with the container and how that is styled combined with the position in the container? :)

  • @total.telugu5503
    @total.telugu5503 3 года назад

    hello your explaination is simply superb

  • @connerdassen7808
    @connerdassen7808 10 месяцев назад

    The three bars of the hamburger menu are stacked on top of each other no matter what, increasing the margin just moves them down

  • @gnomocoder2068
    @gnomocoder2068 Год назад

    You Are The Boss!

  • @hamdikurdi
    @hamdikurdi Год назад

    Hello, your vscode setup is really cool . Can you share it?

  • @omarruiz5423
    @omarruiz5423 3 месяца назад

    After the menu buttons are clicked, does the menu slide back in?

  • @joeyywill1234
    @joeyywill1234 3 года назад +1

    thanks dad xx

  • @Imran-Desk
    @Imran-Desk 2 года назад +1

    Thank you big bro

  • @mikesalinas6245
    @mikesalinas6245 Месяц назад

    Esta chignon el sitio web, lo usare para mi trabajo... haber que tal queda.... gracias!!

  • @rangabharath4253
    @rangabharath4253 3 года назад +1

    Awesome

  • @gunjanpatil5692
    @gunjanpatil5692 3 года назад

    after giving postion: fixed; to the menu, my nav-links are not working??

  • @abiatama
    @abiatama 9 месяцев назад

    why my bars of the hamburger menu are stacked on top?? any solution?

  • @danielfernandezjaime5014
    @danielfernandezjaime5014 5 месяцев назад

    THANK U!!!!!!!!!!!!!!!!!!!!!!!!!

  • @bazeArttutorials
    @bazeArttutorials 4 месяца назад

    good day, after applying you code, when i click on the hamburger it toggles open, but when i click on it the second time it doesnt close the menu, why is this sir?

  • @tipografico4477
    @tipografico4477 2 года назад

    how to add a slider on section banner in this code?

  • @samrad6508
    @samrad6508 Год назад

    how is your logo and hamburger are still showing after you fully give the .mobile-nav a 100% height and width ??

    • @oldmansam95
      @oldmansam95 10 месяцев назад

      Yeah I was confused about that too! Mine gets completely blocked.

  • @letsplat__
    @letsplat__ Год назад +1

    What VS Code Theme are you using?>

  • @knightingirl
    @knightingirl 3 года назад

    Hi, thanks for the video
    Why did you use *.hamburger:after* and *.hamburger:before* , why not *.bar:after* and *.bar:before* instead?

    • @ankishkhandelwal7588
      @ankishkhandelwal7588 2 года назад

      so you see in .hamburger the content is .bar to get three lines
      and in .bar their is no content means if we give .bar::after and .bar::before this will give only two lines
      may be that,s the reason

  • @thewandernationyt
    @thewandernationyt Год назад

    Thanks for the video, but i'm stuck here at the end. If I click a button in mobile nav menu, it don't take me anywhere. I think the navbar should go beck in the it should take me where I want.

    • @Bastian6071
      @Bastian6071 Год назад

      same for me. Have you found a solution yet?

  • @fplfpl7890
    @fplfpl7890 3 года назад

    how to enable this option to show the time when I was on a given line of code?

  • @sauler1637
    @sauler1637 2 года назад +5

    can anyone tell me what did i do wrong? my hamburger menu works just fine, all the animations works... however there's no X sign when the menu is opened
    where could my mistake be?

    • @TylerPotts
      @TylerPotts  2 года назад +3

      Hey, Sauler. Sorry for that, I'm not sure how to help but if you want to join my discord I'm sure someone will be able to assist you! There's so many awesome friendly devs who help eachother out :D

    • @monicagarcia2592
      @monicagarcia2592 2 года назад +1

      I'm having the same issue, did you ever find the solution for this?

    • @Fkamynk
      @Fkamynk 2 года назад +9

      @@monicagarcia2592 I had the same issue but then I realized it's because the X was behind the mobile nav. You have to add a higher z-index than the mobile nav and set the position to relative on the ".hamburger.is-active:after " selection in CSS. So the code would be this:
      .hamburger.is-active:after {
      transform: rotate(50deg) translate(-3px, 2px);
      position: relative;
      z-index: 100;
      }
      .mobile-nav {
      position: fixed;
      z-index: 98;
      }
      I hope that helps 😄

    • @monicagarcia2592
      @monicagarcia2592 2 года назад +1

      @@Fkamynk Thank you SO much. I'm going to give this a try. Really appreciate you replying, i was going crazy trying to figure it out

    • @Fkamynk
      @Fkamynk 2 года назад +1

      @@monicagarcia2592 lmaoo same!

  • @ShivamKumar-vd1rb
    @ShivamKumar-vd1rb 2 месяца назад

    why don't we use font-awesome for hamburger menu

  • @AKSHATmadan_
    @AKSHATmadan_ Год назад

    im trying to make this in react but not working 😓

  • @timifalode5152
    @timifalode5152 Год назад +1

    Pls zoom in on the IDE next time, twas too tiny to watch

  • @cjsport1254
    @cjsport1254 11 месяцев назад

    I didn’t catch an explanation on ‘is-scrolling’

  • @jakeochukoidamatie723
    @jakeochukoidamatie723 2 года назад +1

    followed every step to 8:47min and my hamburger doesn't transform, i don't know what could be wrong, someone please help.

    • @daedalus5070
      @daedalus5070 2 года назад

      Yep had the same issue and its one of two things:
      - Having the hamburger/cross as a button can add a "navigable" class by default so even though the JS is correct, the css never kicks in because the button becomes: ".hamburger .navigable .is-active"
      - 2nd can be hard to spot and sometimes easy to forget: .querySelector uses the css style class wheras 'toggle' doesnt. I had accidentally added ".is-active" instead of just "is-active" in the toggle.
      Hope that helps!

    • @HayWhy_Pappy
      @HayWhy_Pappy Год назад

      @@daedalus5070 still doesn't fix it for me. What could be the problem

    • @HayWhy_Pappy
      @HayWhy_Pappy Год назад

      Hey. How did you fix it ?

  • @yuriyzadorozhnyi3849
    @yuriyzadorozhnyi3849 11 месяцев назад

    Привіт з України ! Дякую тобі друже ! Thanks a lot ! Awesome !!

  • @ethanq2648
    @ethanq2648 Год назад

    6:28 the code for the burger

  • @one9959
    @one9959 Год назад

    It has copyright, or can i use It if i make modifications for My website ?

    • @Bastian6071
      @Bastian6071 Год назад

      It's code. Code has no copyright

    • @one9959
      @one9959 Год назад +1

      @@Bastian6071 ok , i just wanted to use It on My website

    • @Bastian6071
      @Bastian6071 Год назад +1

      @@one9959 yeah you can do so

  • @samrad6508
    @samrad6508 Год назад +1

    10:49

  • @ksriharsha2911
    @ksriharsha2911 3 года назад

    🔥❤️🔥❤️

  • @fitradical
    @fitradical 3 года назад +1

    Niceeee

  • @cryptomjkjx4991
    @cryptomjkjx4991 2 года назад

    My mind was blown....holy shit I didn't you could do that this easily......I was fucking around with if statements when all I could do is classList.toggle. Also that is-active class damn thank you for this video

  • @programmerrdai
    @programmerrdai 3 года назад +2

    2nd

  • @sandyrbierid3603
    @sandyrbierid3603 3 года назад

    Very happy 😍💋 💝💖♥️❤️

  • @AllanOrtegren
    @AllanOrtegren 3 месяца назад

    Where is the indian accent >:(

  • @julianttaneok6390
    @julianttaneok6390 3 года назад

    I'm Single 😍😥

    • @mike4680
      @mike4680 3 года назад +2

      I thought you were Julian.

  • @Anonymous-bhai420
    @Anonymous-bhai420 7 месяцев назад

    your accent is so much confusing😑

  • @zachfenton608
    @zachfenton608 Год назад

    Awesome