点击显示一个隐藏所有其他JS或CSS或"切换"

On click show one hide all others JS or CSS or "Toggle"?

本文关键字:quot 其他 JS CSS 切换 隐藏所 显示 一个      更新时间:2023-09-26

我有以下代码:http://jsfiddle.net/chris_bentley/21onnz5a/

<ul id="header-master-fixed-icon">
<li><a href="#" id="header-master-fixed-search" ></a></li>
<li><a href="#" id="header-master-fixed-account"></a></li>
<li><a href="#" id="header-master-fixed-help"></a></li>
<li><a href="#" id="header-master-fixed-bag"><span id="header-master-fixed-bag-number">5</span></a></li>
</ul>

它们都与点击时弹出的下拉菜单有关。我需要做的是,当一个被点击,其他关闭。现在,当你点击它打开,然后下一个打开的权利上一个。

如何解决这个问题?

使用jQuery

$('#one_dropbox').click(function()
{
  $('#second_dropbox').hide();
});
相关文章: