我在 TS 中使用以下代码创建了一个下拉菜单:
TS:
MAIN_MENU = HMENU
MAIN_MENU {
entryLevel = 0
1 = TMENU
1 {
expAll = 1
# Always output all childs, hide/unhide them with JS
wrap = <ul>|</ul>
# Normal state properties
NO.wrapItemAndSub = <li>|</li> |*| <li>|</li> |*| <li class="last">|</li>
# Enable active state and set properties:
ACT < .NO
ACT = 1
ACT.ATagParams = class="activelink"
ACT.wrapItemAndSub = <li class="active">|</li>
}
2 = TMENU
2 {
wrap = <div class="scnd_menu"><ul>|</ul></div>
NO.allWrap = <ul id="scnd_menu_wrapper"><li><ul class="menu_secondLevel"><li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || </ul></li><li><ul class="menu_secondLevel"><li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || <li>|</li> || </ul></li><li><ul class="menu_secondLevel"><li>|</li> || <li>|</li> |*||*|
ACT < .NO
ACT = 1
ACT.ATagParams = class="activelink"
ACT.allWrap = <li class="active">|</li>
}
}
CSS:
/* Main Menu */
#menu_main {
text-transform: uppercase;
letter-spacing: 2px;
margin-top: 45px;
margin-bottom: 10px;
}
#menu_main ul {
list-style: none;
}
#menu_main ul li {
float: left;
margin-bottom: 0;
margin-left: 25px;
}
#menu_main ul li.active a {
color: #AF0008;
}
#menu_main ul li a {
color: #2c211a;
width: 100%;
text-align: center;
display: block;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 5px;
padding-right: 5px;
}
#menu_main ul li a:hover {
text-decoration: none;
color: #AF0008;
background-color: #F1DED7;
}
#menu_main ul li:hover .scnd_menu, #menu_main ul li:hover ul.menu_secondLevel, #menu_main ul li:hover ul.menu_secondLevel_two, #menu_main ul li:hover ul.menu_secondLevel_three {
display: block;
}
#menu_main .menu_main_sep_right, #menu_main .menu_main_sep_left {
position: absolute;
bottom: 0px;
right: 0px;
display: block;
width: 1px;
height: 69px;
overflow: hidden;
}
#menu_main .menu_main_sep_left {
background-position: bottom right;
left: 0px;
}
/* Sec Menue */
.scnd_menu {
display: none;
position: absolute;
z-index: 999;
padding-top: 5px;
padding-bottom: 5px;
letter-spacing: normal;
width: auto;
max-width: 1030px;
max-height: 365px;
background-color: #fff;
}
#scnd_menu_wrapper {
margin: 0;
width: auto;
}
#scnd_menu_wrapper li {
diplay: block;
margin-left: 5px !important;
}
#scnd_menu_wrapper li:last-child {
float: right;
}
ul.menu_secondLevel {
display: none;
}
#menu_main ul li ul.menu_secondLevel li {
float: none;
width: auto;
margin-left: 0px;
margin-right: 0.5em;
margin-bottom: 5px;
margin-top: 5px;
}
#menu_main ul li ul.menu_secondLevel li a {
display: inline;
width: auto;
font-size: 0.85em;
color: #AF0008;
white-space: nowrap;
}
#menu_main ul li ul.menu_secondLevel li.active,
#menu_main ul li ul.menu_secondLevel li.active a,
#menu_main ul li ul.menu_secondLevel li a:hover {
background: none;
color: #2c211a;
}
#menu_main ul li ul.menu_secondLevel li.active a:hover {
font-style: italic;
}
/* Exeptions */
#menu_main ul li.last {
position: relative;
}
#menu_main ul li.last .scnd_menu {
right: -26px;
}
#menu_main ul li:nth-child(3) .scnd_menu {
margin-left: -155px;
}
#menu_main ul li:nth-child(7) .scnd_menu {
margin-left: -613px;
}
它工作正常,但问题在于,如果我进入第二级的第一页,菜单就会被破坏。它只发生在那里,没有其他地方。
经过两天的尝试,我现在真的很累。似乎有些
谢谢你!