Vanilla JavaScript: Hamburger Menu

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • Hi guys,
    Back with another video where we will be creating an animated hamburger menu with HTML / CSS /JavaScript.
    Thanks for watching.

КОМЕНТАРІ • 20

  • @paulharvey11
    @paulharvey11 2 роки тому

    Hi Conor, I had the same issue as Oscar - the nav links not removing the active menu. Is there a simple fix, I'm sure there must be... I tried adding the code snippet you posted below but am unsure where it should be placed..tried a few places within the code but it didn't work, help, please? btw, loving all of your videos!

  • @oscarm94
    @oscarm94 4 роки тому +2

    Hey Conor, quick question, so my hamburger menu pretty much does the same but I'm struggling to get it to go away once I click on a link. The website is a single page that scrolls. So when the hamburger menu is on the screen and I click on a link I want it to go away on its own. Any way you can point me in the right direction to get this to work?
    Thank you! Amazing video btw!

    • @ConorBailey
      @ConorBailey  4 роки тому +3

      hey Oscar. Thanks for watching mate. You need to loop. through each link and add an event listener to remove the active class from the menu.
      Try this
      navLinks.forEach(link =>{
      link.addEventListener('click', ()=>{
      nav.classList.remove('active');
      })
      })

    • @oscarm94
      @oscarm94 4 роки тому +1

      @@ConorBailey Thank you!! I appreciate the help man! I’m going to try it in the morning cheers! Subscribing now! 🤙🏼🍻

    • @ConorBailey
      @ConorBailey  4 роки тому

      Oscar Caicedo no worries mate.cheers for the sub 👍

    • @paulharvey11
      @paulharvey11 2 роки тому

      HI Oscar, hope it's ok to jump in here... I. had the same issue. It all works really well except for the menu closing when a link is clicked. Did the solution that Conor offered work? if so, where did you place that code? Thanks

  • @austinaneke4165
    @austinaneke4165 Місяць тому

    great work 👌👌👌

  • @clementearriagadafalcone8595
    @clementearriagadafalcone8595 2 роки тому

    dindt work art all for me

  • @paulharvey11
    @paulharvey11 2 роки тому

    Love this

  • @JalukOne
    @JalukOne 3 роки тому

    Gracias amigo estaba buscando algo vanilla y no de "fontawesome"
    Suscrito

  • @airons.manalaysay1579
    @airons.manalaysay1579 3 роки тому

    hey! this is a nice work. Do you still have your source code?

  • @ashtonrichardson3667
    @ashtonrichardson3667 3 роки тому

    I'm not getting an X in the menu toggle, instead im getting something that looks like this (

  • @Rawphael
    @Rawphael 3 роки тому

    very very cool. Definately looks 'smart' as you brits like to say :)

  • @maheshm4292
    @maheshm4292 4 роки тому +1

    Cool Animations..

    • @ConorBailey
      @ConorBailey  4 роки тому

      Mahesh m Thanks for watching and the comment mate!

    • @maheshm4292
      @maheshm4292 4 роки тому

      @@ConorBailey thanks for the tutorials.

  • @olgapolskolg1112
    @olgapolskolg1112 3 роки тому

    great job

  • @Maxiker21
    @Maxiker21 3 роки тому

    awsome :D