Javascript 旋转图像和隐藏菜单
我真的很喜欢他们的导航,我主要想知道他们是如何如此顺利地打开图像的(我假设是jQuery插件,但菜单图标本身不会打开),以及如何通过单击图像来打开和关闭菜单 我试图查看他们的源代码,但CSS难以辨认 顺便说一句,IE中的一切都可以正常工作。他们正在使用 要打开它们使用的图像,请执行以下操作:Javascript 旋转图像和隐藏菜单,javascript,jquery,html,navigation,Javascript,Jquery,Html,Navigation,我真的很喜欢他们的导航,我主要想知道他们是如何如此顺利地打开图像的(我假设是jQuery插件,但菜单图标本身不会打开),以及如何通过单击图像来打开和关闭菜单 我试图查看他们的源代码,但CSS难以辨认 顺便说一句,IE中的一切都可以正常工作。他们正在使用 要打开它们使用的图像,请执行以下操作: .active .icon-menu { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); trans
.active .icon-menu {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
}
.icon-menu {
transition: transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-moz-transition: -moz-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-webkit-transition: -webkit-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-o-transition: -o-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
}
为了使其动画化,他们使用:
.active .icon-menu {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
}
.icon-menu {
transition: transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-moz-transition: -moz-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-webkit-transition: -webkit-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
-o-transition: -o-transform .3s cubic-bezier(0.785,0.135,0.15,0.86);
}
定义了这些样式后,动画基本上是通过在相应的
元素上添加或删除.active
类来触发的。我编辑了您的问题,因为它最初不是问题!