jquery - CSS menu vs JavaScript menu - Stack Overflow

In making a drop down menu, there are jQuery menus like superfish and pure CSS menus. Is there any diff

In making a drop down menu, there are jQuery menus like superfish and pure CSS menus. Is there any difference between JS menus and CSS menus?

I don't need onclick event to overwrite the default anchor. I just need to be able to click the menu item then follow the <a href="...">...</a> to another page.

In making a drop down menu, there are jQuery menus like superfish and pure CSS menus. Is there any difference between JS menus and CSS menus?

I don't need onclick event to overwrite the default anchor. I just need to be able to click the menu item then follow the <a href="...">...</a> to another page.

Share Improve this question edited Jul 14, 2011 at 4:19 icktoofay 129k23 gold badges259 silver badges237 bronze badges asked Jul 14, 2011 at 4:16 WeiyanWeiyan 1,1163 gold badges14 silver badges25 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 2

Differences:

  1. JavaScript break down if user has disabled JavaScript; CSS menus won't work if user has disabled CSS (which is less mon)
  2. JavaScript made via libraries like jQuery are more cross-browser, due to the fact that cross-browser issues are handled by library
  3. JavaScript menus are more flexible, as CSS still is not enough mature for creating highly plicated effects (don't forget that JavaScript is a programming language, and a programming language means that you can do almost anything you want. But CSS is more like declarative fashioned)
  4. CSS menus are usually lighter in size (see Thought Results for example), but this is not a big deal in today's Internet speeds users have.
  5. Sometimes in a menu, you need grouping, which is not achievable via CSS, but can be done in JavaScript. (grouping means that you want to open a drop down on click of an item, not following the link address. Of course, in your case, this is not a requirement)

From a philosophical standpoint, CSS is really about styling, JS about interaction. However, now that WebKit has gone full-throttle with CSS transitions, that line has blurred quite a bit.

In the end, it's great to use CSS as much as you can, then add JavaScript for that added level of polished interaction. Things like keyboard navigation...subtle delays to allow a mouse to travel from one link to the next...animations, etc.

Even thought I am a developer, I always try to avoid programming at all.

I think I will go with a CSS menu that will show the drop menu DIV using the onHover event.

JavaScript could be influenced by other apps, maybe duplicating variables. And you can port it easily to mobile devices that usually don't support JS

An obvious difference is that JS menus are a lot more customizable. You can't control things like how fast a menu appears using just CSS.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744355152a4570194.html

相关推荐

  • jquery - CSS menu vs JavaScript menu - Stack Overflow

    In making a drop down menu, there are jQuery menus like superfish and pure CSS menus. Is there any diff

    7天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信