开发者

create css sub menu from sub

开发者 https://www.devze.com 2023-03-10 10:40 出处:网络
hello what i am trying to is to create a sub menu from a sub menu. for example if a user hovers over Actions this then drops to show say billing - mail etc. i would like to create another sub if a use

hello what i am trying to is to create a sub menu from a sub menu. for example if a user hovers over Actions this then drops to show say billing - mail etc. i would like to create another sub if a user hovers over billing. i have attached the code i am using which is stu nicholls pro dropdown. thanks

menu css

.nav {
height:35px; 
background: url(images/pro_line_0.gif) repeat-x;
margin-top:100px;
position:relative; 
font-family:arial, verdana, sans-serif; 
font-size:11px; 
width:100%; 
z-index:500;

}

.nav .table {
display:table; 

}

.nav .select,
.nav .current {
margin:0; 
padding:0; 
list-style:none; 
display:table-cell; 
white-space:nowrap;
}

.nav li {
margin:0; 
padding:0; 
height:auto; 
float:left;
}

.nav .select a {
display:block; 
height:35px; 
float:left; 

padding:0 5px 0 30px; 
text-decoration:none; 
line-height:35px; 
white-space:nowrap; 
color:#fff;
}

.nav .current a {
display:block; 
height:35px; 
float:left; 
background: url(images/pro_line_2.gif); 
padding:0 0 0 10px; 
text-decoration:none; 
line-height:35px; 
white-space:nowrap; 
color:#fff;
}


.nav .current a b {
display:block; 
padding:0 30px 0 15px; 
background:url(images/pro_line_2.gif) right top;
}

.nav .select a:hover, 
.na开发者_如何学运维v .select li:hover a {

padding:0 0 0 15px; 
cursor:pointer; 
color:#088;
}

.nav .select a:hover b, 
.nav .select li:hover a b {
display:block; 
float:left; 
padding:0 5px 0 15px; 

cursor:pointer;
}

.nav .select_sub {
display:none;
}

/* IE6 only */
.nav table {
border-collapse:collapse; 
margin:-1px; 
font-size:1em; 
width:0; 
height:0;
}

.nav .sub {
display:table; 
padding:0; 
list-style:none;
}

.nav .sub_active .current_sub a, 
.nav .sub_active a:hover {
background:transparent; 
color:#f00;
}

.nav .select :hover .select_sub, 
.nav .current .show {
display:block; 
position:absolute; 
width:100%; 
top:35px;
background:url(images/back_0.gif);*/
padding:0; 
z-index:100; 
left:0px; 
text-align:left;
}

.nav .current .show {
z-index:10;
}

.nav .select :hover .sub li a, 
.nav .current .show .sub li a {
display:block; 
float:left; 
background:transparent; 
padding:0 5px 0 30px; 
margin:0; 
white-space:nowrap; 
border:0; 
color:#444;
}

.nav .current .sub li.sub_show a {
color:#088; 
cursor:default; 
/*background:url(images/back_1.gif);*/

}

.nav .select :hover .sub li a:hover, 
.nav .current .sub li a:hover {
visibility:visible;
font-weight:bold;
/*background:url(images/back_1.gif);*/
}

sample html

<ul class="select"><li><a href="#nogo"><b>Control Panel</b>
<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
    <div class="select_sub show">
        <ul class="sub">
            <li><a href="/sample/admin/cp/mail/index.php">Tickets</a></li>
            <li><a href="#nogo">Messages</a></li>
            <li><a href="/sample/admin/cp/actions/index.php">Actions</a></li>
            <li><a href="/sample/admin/userlog.php">History</a></li>
            <li><a href="#nogo">Settings</a></li>
            <li><a href="#nogo">Destruction</a></li>
            <li><a href="/sample/admin/cp/contacts/index.php">Contacts</a></li>
            <li><a href="/sample/admin/cp/users/index.php">Users</a></li>
            <li><a href="/sample/admin/cp/companies/index.php">Companies</a></li>
        </ul>
    </div>


Try using nested <ul>s in your HTML. That is, build your menu like so:

<ul class="menu">
  <li>
    <a>My Link</a>
    <ul class="submenu">
      <li><a>My Nested Link</a></li>
  </li>
</ul>

Then use a simple Javascript solution like Superfish (or one of your chosing) http://users.tpg.com.au/j_birch/plugins/superfish/

0

精彩评论

暂无评论...
验证码 换一张
取 消