CSS 下拉菜单,可见不起作用
编辑:以防万一将来有人发现这一点,我发现解决方案是从使用visibility:更改为display:,所以在代码中
visibiliy:hidden;变为显示:无; 可见的: 可见的;变成显示:块;
还没有确切地知道为什么它的可见性在第四个嵌套上不起作用,但至少这似乎解决了这个问题
嗨,大家好,
我目前正在使用一个使用一些 CSS 和列表创建的下拉菜单。它工作正常,但由于某种原因,该菜单的第四级没有监听visibility:hidden;命令。根据元素检查器,该元素被列为已启用,但实际上并未执行此操作。
示例如下:http://dev.hutchup.com/test/css-dropdown。 htm
我不会过去的代码,因为它太日志了,可以在上面的链接中看到
,您可以看到第一个 2 级链接,当鼠标悬停在显示级别 3 和 4 时,它应该只显示 3,然后当将 3 中的 li 翻过来将显示第 4 级。
我知道有很多更简单的方法可以做到这一点/预建的事情,但我需要这样做,以便我可以使用 joomla 的 ACL 组件并且不显示菜单项。
我花了几个小时但无法修复它,所以提前谢谢你!
EDIT: Just incase anyone in the future finds this i found the solution was to change from using visibility: to display: , so in the code
visibiliy:hidden; becomes display:none;
visibiliy:visible; becomes display:block;
Have not ever found out exactly why it visibility doesn't work on the 4th nesting but atleast this appears to fix it
Hi Guys,
I am currently working with a dropdown menu that is created using some CSS and lists. It is working fine but for some reason the 4th level of this menu is not listening to the visibility:hidden; command. According to element inspector The element is listed as being enabled but it is not actually doing it.
An example is here: http://dev.hutchup.com/test/css-dropdown.htm
I wont past code as it is too log and can be see at the link above
As you can see the first level 2 link when hovered over displays level's 3 and 4 when it should only display 3, and then when an li in 3 is rolled over it will display 4th level.
I know there are many easier ways to do this/ prebuilt thing but i need to do it this way so that i can use the ACL component for joomla and have menu items not display .
Ive spent hours and cant get it fixed so thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定,但是如此多的嵌套级别是一件可怕的事情,在当今时代,通过一些带有后备功能的简单 JavaScript 可能会更好地处理(特别是如果它是大量嵌套级别),尽管我确实注意到了两件事;
像这样 ;
这些 li.item[n] 项目要么是其他东西留下的,要么是一些未实现的未来想法,但它们肯定不适用于相关菜单。
Not sure, but this many levels of nesting is scary business and in this day and age probably better handled by some simple JavaScript with fallback (especially if it's tons of nested levels), although I did notice two things ;
like this ;
These
li.item[n]
items are either leftover from something else or some future ideas not implemented, but they certainly do not apply to the menu in question.