JQuery:不希望“打开悬停”手风琴菜单上的状态
大家好,
我有一个手风琴菜单,是根据我在 DynamicDrive 上找到的 这个 改编的.com。 该手风琴不是典型的 UL 型手风琴,而是隐藏和显示 DIV。
我需要标题的 3 种状态:
- 关闭(黑色文本/白色背景)
- 关闭悬停(白色文本/黑色背景)
- 打开(红色文本/白色背景)
目前有第四种状态(打开悬停),但我不想要这个。
如何使打开状态没有悬停?(或者使其处于独特的悬停状态)。目前,脚本将相同的 close-hover css 样式应用于 open-hover 状态。
这里是JSFiddle上的代码。我知道那里有很多 JavaScript,但任何帮助将不胜感激。
Hi Everyone
I have an accordion menu that I've adapted from this one I found on DynamicDrive.com.
Instead of the typical UL type accordion, this one hides and reveals DIVs.
I need 3 states for the headings:
- Closed (black text / white background)
- Closed Hover (white text / black background)
- Open (red text / white background)
At the moment there is a 4th state (Open Hover), but I don't want this.
How do I make the open state have no hover? (or have it's on unique hover state). At the moment the script applies the same closed-hover css style to the open-hover state.
Here is the code on JSFiddle. I know there is a lot of JavaScript there, but any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的意思是这样的:更新小提琴
如果这就是你想要的唯一的变化是在 CSS 中。我必须使
.openheader
链接规则更加具体(通过将 a 放在它前面)以匹配a.menuitem< 的特殊性/代码> links..然后确保所有
a.menuitem
规则都位于a.openheader
规则之前do you mean like this: Updated fiddle
if that's what you're after the only changes are in the CSS.. I had to make the
.openheader
link rule more specific (by putting the a in front of it) to match the specificity of thea.menuitem
links.. then made sure all thea.menuitem
rules were preceding thea.openheader
one