【发布时间】:2012-09-05 10:20:03
【问题描述】:
我的网站使用了 wordpress 21 主题。现在我想为我的网站创建一个下拉菜单。默认情况下,wordpress 具有下拉菜单功能。现在,当我将鼠标悬停在主菜单上时,我得到了子菜单部分。例如:-
我有一个主菜单,例如:- 主页 |关于 |联系方式
当我将鼠标悬停在“关于”菜单上时,它会显示“关于”菜单的子菜单,例如
首页 |关于 |联系方式
Our Services
History
Our Staff
当我将鼠标悬停在历史菜单上时,它会显示历史菜单的子菜单,如下所示:-
首页 |关于 |联系方式
Our Services
History
History 1
History 2
History 3
Our Staff
但是当我将鼠标悬停在关于菜单上时,我想显示历史的子菜单。如果我将鼠标悬停在“关于”菜单上,它应该显示如下:-
首页 |关于 |联系方式
Our Services
History
History 1
History 2
History 3
Our Staff
请帮我在 wordpress 菜单中获取输出。
#access {
background: #00ADEE; /* Show a solid color for older browsers */
clear: both;
display: block;
width: 915px;
}
#access ul {
font-size: 11px;
list-style: none;
margin: 0;
padding: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
color: #eee;
display: block;
line-height: 12px;
padding: 4px 9px;
text-decoration: none;
background: url(images/menu-border.png);
background-position: right 6px;
background-repeat: no-repeat;
text-transform: lowercase;
}
#access ul ul {
display: none;
float: left;
margin: 0;
position: absolute;
left: 11px;
width: 252px;
z-index: 99999;
background: #FFFFFF;
padding: 0 4px;
border: 1px solid #00AEEF;
}
#access ul ul li {
}
#access ul ul ul {
left: 23%;
top: 0;
border: none;
width: 150px;
}
#access ul ul ul li{
border: none;
width: 112px;
background:url(images/list.png);
background-position: 0 10px;
background-repeat: no-repeat;
background-color: #FFF;
width: 185px;
}
#access ul ul ul a{
border: none;
background: transparent;
}
.sub-menu .menu-item-object-custom a:hover{
height: 40px;
}
#access ul ul a {
border-bottom: 1px solid #BCBEC0;
color: #000;
font-size: 10px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 5px 7px;
width: 237px;
}
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
color: #000;
}
#access ul ul > a {
color: #000;
}
#access li:hover > a,
#access a:focus {
color: #FFFFFF;
}
#access ul li:hover > ul {
display: block;
}
#access ul ul .current_page_item > a {
color: #00ADEE;
font-weight: bold;
}
#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
color: #FFFFFF;
}
【问题讨论】:
-
详细阐述你的插图。 .太混乱了
-
其实这只是wordpress 21 主题中的一个下拉菜单和类似上面的下拉菜单。第一个暗区是第一个下拉菜单,主菜单部分是所有暗区的上方。 “首页|关于|联系”。第二个暗区是默认输出,第三个暗区是我想要的输出。当我将鼠标悬停在“关于”菜单上时,我希望显示第三个暗区类型下拉菜单。
-
我看不出第二个和第三个暗区有什么区别。 .
-
嘿 coosal 我已经描述了第二个状态是我将鼠标悬停在“历史”子菜单上时的状态,而第三个状态是我将鼠标悬停在“关于”菜单上时的状态。我想要的,所以第二个和第三个是相同的,但是当您将鼠标悬停在子菜单历史上时,它会显示为第二个区域,但是当我将鼠标悬停在“关于”菜单上时,它会显示为第二个。第二个和第三个肯定是一样的。