简体   繁体   English

jQuery飞出菜单-如何用行分隔两个不同的项目

[英]jQuery fly out menu - How to separate two different items with line

I have a fly out menu similar to the one on this page http://jc-designs.net/demo/flyout.html 我有一个类似于此页面上的弹出菜单的页面http://jc-designs.net/demo/flyout.html

When hovering over the main tabs, is it possible to insert a line between one more items on this menu? 将鼠标悬停在主选项卡上时,是否可以在此菜单上的另一个项目之间插入一行?

So for "Home" instead of: 因此,对于“家”而不是:

About this template here 关于此模板
Flash
jQuery jQuery的

It would be: 这将是:

About this template here 关于此模板
-------------------------------------- --------------------------------------
Flash
-------------------------------------- --------------------------------------
jQuery jQuery的

The best way is to do it in css adding something like 最好的方法是在CSS中添加类似

.listTab li{
   border-bottom: 1px;
   border-style : dashed;
}

Add a bottom border to each item: 为每个项目添加底部边框:

var sel = "ul > li > ul > li";
$(sel).css("border-bottom", "black solid 1px");

You can also conditionally not add this styling to the last element ( :last-child ) 您也可以有条件地不将此样式添加到最后一个元素( :last-child

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM