Code Monkey home page Code Monkey logo

Comments (18)

haIIux avatar haIIux commented on September 24, 2024 1

Thank you for this! I'm transitioning from Bootstrap back to non-framework setups. I am only 3 weeks into my journey of web development and this was a big help.

from aleksandrhovhannisyan.com.

WatheqAlshowaiter avatar WatheqAlshowaiter commented on September 24, 2024 1

Thank you for this amazing article!

from aleksandrhovhannisyan.com.

Crunchy409 avatar Crunchy409 commented on September 24, 2024 1

WOW! This is awesome!! Thanks so much for the amazing explanations. It is extremely helpful for a novice hobbyist like myself!

from aleksandrhovhannisyan.com.

APourhadi avatar APourhadi commented on September 24, 2024 1

Thanks a lot, i'm looking for something like this ...
very good step by step explanations.

from aleksandrhovhannisyan.com.

windddddd1 avatar windddddd1 commented on September 24, 2024 1

you are awesome! thanks you so much

from aleksandrhovhannisyan.com.

AleksandrHovhannisyan avatar AleksandrHovhannisyan commented on September 24, 2024 1

@hello-jeff Thanks! I haven't, no.

from aleksandrhovhannisyan.com.

AleksandrHovhannisyan avatar AleksandrHovhannisyan commented on September 24, 2024 1

@MohammadSeyedabadi You'll need to use the useState hook instead of useEffect to track the visibility state. Something like:

const [isNavbarExpanded, setIsNavbarExpanded] = useState(false);

Then update that state when the button is clicked, and use the state to set various attributes accordingly, e.g.:

aria-expanded={isNavbarExpanded}

from aleksandrhovhannisyan.com.

AleksandrHovhannisyan avatar AleksandrHovhannisyan commented on September 24, 2024

@haIIux Glad to hear that it helped, and good luck with learning web dev!

Also, heads up in case you ever revisit this blog post: I realized that it's been a while since I originally wrote this, so I went back and refactored some of the code to use better naming conventions and reduce some of the clutter for future readers.

Cheers!

from aleksandrhovhannisyan.com.

anudeepbommidi avatar anudeepbommidi commented on September 24, 2024

This is awesome! Thanks

from aleksandrhovhannisyan.com.

AleksandrHovhannisyan avatar AleksandrHovhannisyan commented on September 24, 2024

@Crunchy409 Glad to hear that! Thanks for reading 😄

from aleksandrhovhannisyan.com.

AmandaCarlen avatar AmandaCarlen commented on September 24, 2024

This was great, thanks!

from aleksandrhovhannisyan.com.

hello-jeff avatar hello-jeff commented on September 24, 2024

This is great! Thank you for creating this and sharing it. Have you ever added a drop down option to it?

from aleksandrhovhannisyan.com.

aziz13naufal avatar aziz13naufal commented on September 24, 2024

thank you very much, very detailed explanation

from aleksandrhovhannisyan.com.

6026961mborijnland avatar 6026961mborijnland commented on September 24, 2024

i have a problem with the nav bar in iphone mode. the nav bar doenst show when you click on the navbar

from aleksandrhovhannisyan.com.

MohammadSeyedabadi avatar MohammadSeyedabadi commented on September 24, 2024

Thanks so much for the amazing explanations.

But how i can use this navbar in a React project?

I tried using useEffect Hook, and it worked fine, but when i click on nav links, the whole page re renders.( other links are fine )

By the way im using React router dom.

This is the link to my code on github.

https://github.com/MohammadSeyedabadi/flower-shop/blob/master/src/components/Navbar.js

Sorry im new in web developing.

from aleksandrhovhannisyan.com.

MohammadSeyedabadi avatar MohammadSeyedabadi commented on September 24, 2024

@MohammadSeyedabadi You'll need to use the useState hook instead of useEffect to track the visibility state. Something like:

const [isNavbarExpanded, setIsNavbarExpanded] = useState(false);

Then update that state when the button is clicked, and use the state to set various attributes accordingly, e.g.:

aria-expanded={isNavbarExpanded}

I tried it now and it worked very well and solved my problem😁😁😁
thank you very much❤️
you are amazing🌹

from aleksandrhovhannisyan.com.

JuGecko avatar JuGecko commented on September 24, 2024

Hi! The navbar works, there's just one issue: when on phone, I'd like it to dissapear after clicking on any link. I created a simple landing page and the links in the navbar are not opening in a new window, they just scroll down to certain section of the page.
So basically, right now after clicking on a link in the navbar, it scrolls down and doesn't dissapear. I'd like to fix that. If you need any files from me, please inform me here.
Thanks!

from aleksandrhovhannisyan.com.

MohammadSeyedabadi avatar MohammadSeyedabadi commented on September 24, 2024

@JuGecko You have to set an onclick on each of the links,
that onclick should execute the function which is responsible for closing the menu, something like : onclick="closeMenu()"

if you are using ReactJS, you have to call that function and let React execute it for you, something like : onClick={closeMenu}
so without paranthesis at the end of the function name

from aleksandrhovhannisyan.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.