0

我有一个创建菜单的任务。在这里,我想在选择其子菜单时将箭头图像设置为菜单。我用这个图像做了一个例子。但是我想从那个onload中删除那个图像,并在我们选择它的子菜单时显示它。只应显示选定的菜单图像。

我的css文件是

 #menu {
     font-family: Arial;
     font-size: 12px;
     //background: #F8F8F8;
 }
 #menu > li > a {
     font-family: Verdana, Arial, sans-serif;
     font-style: normal;
     color:#787878;
     font-weight: bold;
 }
 #menu > li > a:hover {
     color: #000;
 }
 #menu ul {
     background: none repeat scroll 0 0 #FFFFFF;
    border-radius: 0 0 5px 5px;
    margin-top: 1px;
 }
 #menu ul li a {
     color: #000;
 }
 #menu ul li a:hover {
     background: #E0E0E0;
 }
 .logout {
     float:right;
     width:300px;
 }
 .title {
     float:left;
     width:300px;
 }
 #footer {
     width:100%;
     height:100px;
     float:left;
 }
 .subchild-list {
     margin:0;

     position: absolute !important;
     top:0;
     right:-87px;
     //border-color: #ccc #FFFFFF #ccc #FFFFFF;
 }
 .child-list ul {
     display: none !important;
     position: absolute !important;
     z-index: 999 !important;
 }
 .child-list li {
     position:relative !important;

 }
 .child-list li:hover ul {
     display: block !important;
 }

.child-list li{

    border-left:1px solid #C0C0C0; 
    border-right:1px solid #C0C0C0;
}

.child-list ul{
    border-top:1px solid #C0C0C0; 
    border-bottom:5px solid #C0C0C0; 
}

.child-list{
    border-bottom:5px solid #C0C0C0; 
}
.nav-subchild
{
    border-color: #ccc #FFFFFF #ccc #FFFFFF;
}
#nav > ul > li:hover {
 border-color: #ccc #ccc #FFFFFF;
 border-style: solid;
 border-width: 1px;
 padding-bottom: 0;
 border-radius:1px;
 }

#menu > li {
border-bottom:#ccc;
border-left: 1px solid #fff;
border-right: 1px solid #fff;
border-top: 1px solid #fff;
}
#nav ul li:hover ul { margin-left:-1px; } #nav ul li ul:hover { margin-left:-1px; }
ul li ul li 
{
    width: 180px;
}
.subchild-list {
    margin:0;
    right:-183px;
    position: absolute !important;
    top:0;
}
.hassub {
    background: url('arrow.gif') right no-repeat;
}
#menu li:hover > a {
    color: #000;
        font-weight:bold;
}

我怎么解决这个问题?

4

3 回答 3

1

现在只需定义这个 css

#menu .child-list > li:hover > a {
background: #E0E0E0 url(http://www.coeliac.org.uk/sites/coeliac.org.uk/themes/coeliac/images/icon_arrow_small_right.gif) right no-repeat;
}

现场演示

于 2013-03-04T05:46:33.847 回答
1

看看这个..

#menu ul li a:hover {
  background:url(http://www.coeliac.org.uk/sites/coeliac.org.uk/themes/coeliac/images/icon_arrow_small_right.gif) right no-repeat #E0E0E0;
     }

现场演示

于 2013-03-04T06:19:32.867 回答
0

这是几个变化

#menu ul li a:hover {
    // background: #E0E0E0;
     background:url(http://www.coeliac.org.uk/sites/coeliac.org.uk/themes/coeliac/images/icon_arrow_small_right.gif) right no-repeat;
 }

.hassub {
 //   background: //url(http://www.coeliac.org.uk/sites/coeliac.org.uk/themes/coeliac/images/i//con_arrow_small_right.gif) right no-repeat;
}

现场演示

于 2013-03-04T05:54:11.050 回答