CSS或JavaScript的下拉菜单 [英] Dropdown menus by CSS or JavaScript

查看:119
本文介绍了CSS或JavaScript的下拉菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个初学者WWW开发人员,我想知道下拉菜单是否应该用CSS或JavaScript编写。

I'm a beginner WWW-developer and I'm wondering whether the dropdown menus should be written in CSS or JavaScript. What are the pros and cons between two techniques?

推荐答案

我想推荐尽可能使用CSS。因为这些将消除问题,如如果有人得到JS禁用和任何其他可能的辅助功能问题。由于菜单是网站导航的一个组成部分,因此所有用户细分都可以访问这些菜单。您可以对纯CSS使用,但如果您使用Google的纯CSS菜单,则还有许多在线教程。此外,您还可以查看此处的jQuery& ; CSS菜单示例

I would like to recommend using just CSS as much as you can. As these will eliminate issues such as if someone got JS disabled and any other possible accessibility issues. Since menus are an integral part of you site navigation, it is important these are accessible to all the user segments. You can use this for pure CSS but also there are lots of tutorials online if you google "pure css menus". Also you can see here for jQuery & CSS menu example

这篇关于CSS或JavaScript的下拉菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆