What is the rationale behind choose a complete CSS based menu and Javascript/CSS based menu?
What would be the points you validate when considering a new menu for your website?
- Why should i choose complete CSS based menu ?
- Why should i choose Javascript/CS开发者_运维问答S based menu ?
- whats is the benefit in choosing either of them?
Is CSS menu old ? or is it limited in features! I dont think CSS menu is old as i still a pick a thousand web2.0 site using complete CSS menu (No javascript to control its dropdowns).
I default to pure CSS unless there is something I can't pull off with CSS animations, then I'll consider switching to JS. It's pretty rare you'll need the JS unless you need some fancy timed animation across multiple elements or something wacky that CSS animations can't handle.
Using pure CSS the menu still works even when the client has JS disabled. Plus with pure CSS it's usually less code, which is always nice.
A nice way to look at it: would you use JS to change the color of a link when you hover over it, or CSS? This is just a more complicated, but usually similar, question.
CSS controls the layout (and limited interactions, such as hover
) while Javascript controls logic.
If you don't need any logic in your menu (such as displaying a hidden div element as a submenu), then using CSS on its own is just fine.
精彩评论