我怎么能说"如果#菜单的显示是块然后设置#按钮的显示是块"在js和jquery中

how can i say "if display of #menu is block then set the display of #button is block" in js and jquery

本文关键字:显示 quot js jquery 按钮 然后 菜单 怎么能 如果 设置      更新时间:2023-09-26

我希望导航图标在菜单打开时变成X。有人知道怎么做吗?我没有真正尝试过任何东西,因为我对js和JavaScript知之甚少。

谢谢

这是你需要的吗?

span{
  display:block;
  width: 30px;
  height: 4px;
  background: black;
  margin:3px;
  cursor: pointer;
  transform-origin: 20% 60%;
  transition: all .3s ease;
}
span.active1{
  transform: rotate(45deg);
}

查看此工作演示:https://jsfiddle.net/yg1v0wtm/2/