2011-04-08 4 views
0

style.css에서 탐색 스타일을 수정했습니다. 드롭 다운 메뉴를 수정하고 싶습니다. 주 메뉴에 하나의 이미지를 넣었습니다. 메뉴를 마우스로 이동하면 마우스 오버 이미지로 바뀝니다. 하지만 하위 메뉴에서 마우스 오버를 원할 때 부모 메뉴 (메인 메뉴)가 마우스 오버 이미지에 머물러 있지 않지만 마우스 오버 전에 이미지로 돌아갈 때 문제가 있습니다. 이 링크 http://alfo.com.my/default/about/company-background/에서 웹 사이트를 미리 볼 수 있습니다.wordpress navigation problem

나는 해결책을 얻을 수 있기를 바랍니다.

다음은 스타일 드롭 다운의 코딩 수정 :

/*========Navi========*/ 
ul#menu-alfo { 
    list-style: none; 
    } 
    ul#menu-alfo li { 
     display: inline; 

    } 
    ul#menu-alfo li a { 
     text-indent: -9999px; 
     display: block; 
     float: left; 
     } 
     ul#menu-alfo li.menu-item-87 a{ 
      background: url(images/navi.png) no-repeat bottom center; 
      width: 118px;  height: 38px; 
      } 
     ul#menu-alfo li.menu-item-86 a{ 
      background: url(images/navi-02.png) no-repeat bottom center; 
      width: 101px;  height: 38px; 
     } 
     ul#menu-alfo li.menu-item-84 a{ 
      background: url(images/navi-03.png) no-repeat bottom center; 
      width: 127px;  height: 38px; 
     } 
     ul#menu-alfo li.menu-item-83 a{ 
      background: url(images/navi-04.png) no-repeat bottom center; 
      width: 116px;  height: 38px; 
     } 
     ul#menu-alfo li.menu-item-85 a{ 
      background: url(images/navi-05.png) no-repeat bottom center; 
      width: 111px;  height: 38px; 
      } 

      ul#menu-alfo li.menu-item-87 a:hover, ul#menu-alfo li.menu-item-87 a:active, 
      ul#menu-alfo li.menu-item-86 a:hover, ul#menu-alfo li.menu-item-86 a:active, 
      ul#menu-alfo li.menu-item-84 a:hover, ul#menu-alfo li.menu-item-84 a:active, 
      ul#menu-alfo li.menu-item-83 a:hover, ul#menu-alfo li.menu-item-83 a:active, 
      ul#menu-alfo li.menu-item-85 a:hover, ul#menu-alfo li.menu-item-85 a:active, 
      body.page-id-50 ul#menu-alfo li.menu-item-87, 
      body.page-id-56 ul#menu-alfo li.menu-item-86, 
      body.page-id-58 ul#menu-alfo li.menu-item-84, 
      body.page-id-31 ul#menu-alfo li.menu-item-83, 
      body.page-id-52 ul#menu-alfo li.menu-item-85, 
      body.single ul#menu-alfo li.menu-item-87{ 
       background-position: top center; 
      } 
      ul#menu-alfo ul.sub-menu li { 
       margin-left:10px; 
       height:13px; 
       padding: 6px 0px; 


      } 
      ul#menu-alfo ul.sub-menu li a:hover { 
       margin-left:1px; 
       height:13px!important; 


      }    
     ul#menu-alfo ul.sub-menu li a{ 
    background: none repeat scroll 0 0 transparent; 
    color: #000000; 
    font: bold 13px Arial; 
    min-width: 170px; 
    padding: 5px 10px; 
    text-decoration: none; 
    text-indent: inherit; 
     } 

     ul#menu-alfo ul.sub-menu a:hover{ 
      color:#565BBA !important; 

     } 

     #menu-alfo .menu-header, 
div.menu { 
    font-size: 13px; 
    margin-left: 12px; 
    width: 988px; 
} 
#menu-alfo .menu-header ul, 
div.menu ul { 
    list-style: none; 
    margin: 0 0 0 -17px; 
} 
#menu-alfo .menu-header li, 
div.menu li { 
    float: left; 
    position: relative; 
} 

#menu-alfo ul ul{background:#fff;} 

#menu-alfo ul ul li { 

    background-position: top center; 

} 
#menu-alfo ul ul li a{ 

color: #FFF; 
font-size:12px; 
font-weight:bold; 

} 
#menu-alfo li:hover a, 
#menu-alfo ul ul :hover a { 
    background-position: top center; 

} 

#menu-alfo ul ul li:hover a, 
#menu-alfo ul ul :hover a { 

    background-position: top center; 

} 

#menu-alfo ul ul li:hover a, 
#menu-alfo ul ul :hover a { 

background-position: top center; 


} 
#menu-alfo ul li:hover ul { 
    display: block; 
} 



ul#menu-alfo li.current_page_item a, 
ul#menu-alfo li.current-menu-ancestor a, 
ul#menu-alfo li.current-menu-item a, 
ul#menu-alfo li.current-menu-parent a { 

    background-position: top center; 
    padding:0; 
} 
ul#menu-alfo li.current_page_item a, 
ul#menu-alfo li.current-page-menu-ancestor a, 
ul#menu-alfo li.current-page-menu-item a, 
ul#menu-alfo li.current-menu-parent a { 

    background-position: top center; 
    padding:0; 
} 
ul#menu-alfo li.current-page-ancestor a { 

    background-position: top center; 
    padding:0; 
} 

#menu-alfo ul ul li.current_page_item a, 
#menu-alfo ul ul li.current-menu-ancestor a, 
#menu-alfo ul ul li.current-menu-item a, 
#menu-alfo ul ul li.current-menu-parent a { 
    background-position: top center;  
    padding:0; 
} 

#menu-alfo li.current_page_item a:hover {background-position: top center;} 
#menu-alfo li.current_page_parent ul li a:hover {background-position: top center;} 

* html #menu-alfo ul li.current_page_item a, 
* html #menu-alfo ul li.current-menu-ancestor a, 
* html #menu-alfo ul li.current-menu-item a, 
* html #menu-alfo ul li.current-menu-parent a, 
* html #menu-alfo ul li a:hover { 
    background-position: top center; 
    padding:0; 
} 


/*=====end navi=====*/ 

/* =Menu 
-------------------------------------------------------------- */ 

#access { 

    display: block; 
    float: left; 
    margin: 0 auto; 
    width: 600px; 
} 
#access .menu-header, 
div.menu { 
    font-size: 13px; 
    margin-left: 12px; 
    width: 928px; 
} 
#access .menu-header ul, 
div.menu ul { 
    list-style: none; 
    margin: 0; 
} 
#access .menu-header li, 
div.menu li { 
    float: left; 
    position: relative; 
} 

#access ul ul { 
    box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
    -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
    -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 
    display: none; 
    position: absolute; 
    top: 38px; 
    left: 0; 
    float: left; 
    width: 180px; 
    z-index: 99999; 
} 
#access ul li.menu-item-87 ul { /*-----Dropdown with diffrent height------- */ 
    background:url(images/bgmenu1.png); 
    width:200px; 
    height:130px; 
} 
#access ul li.menu-item-85 ul{ /*-----Dropdown with diffrent height------- */ 
    background:url(images/bgmenu2.png); 
    width:200px; 
    height:170px; 
} 
#access ul ul ul { 
    left: 100%; 
    top: 0; 
} 
#access ul ul a { 

} 
#access li:hover > a, 
#access ul ul :hover > a { 
    background: #333; 
    color: #fff; 
} 
#access ul li:hover > ul { 
    display: block; 
} 
#access ul li.current_page_item > a, 
#access ul li.current-menu-ancestor > a, 
#access ul li.current-menu-item > a, 
#access ul li.current-menu-parent > a { 
    color: #fff; 
} 
* html #access ul li.current_page_item a, 
* html #access ul li.current-menu-ancestor a, 
* html #access ul li.current-menu-item a, 
* html #access ul li.current-menu-parent a, 
* html #access ul li a:hover { 
    color: #fff; 
} 

답변

0

내 첫번째 생각은 우리가 다른 요소를 가리킬 때 요소의 스타일을 변경하는 CSS를 사용하는 방법을 찾을 수 있습니다. 내 대답은 '아니오'라고 생각합니다.

그럼 우리는 대안에 대해 생각해 볼 필요가 있습니다. 가장 직접적인 방법은 하위 메뉴의 배경 이미지에 빛나는 메뉴 항목을 포함시키는 것입니다. 이것은 각 하위 메뉴마다 다른 그래픽과 위치 지정 등의 변경을 의미합니다. 계획해야 할 다른 문제가 거의 확실하게 있습니다.

여러분도 알다시피이 모든 것을 완전히 생각하지는 않았으므로 이것을 완벽한 계획이 아니라 출발점으로 삼으십시오.

실제로, 당신은 상대적으로 작은 이익을위한 노력의 가치가 없다고 결론 지을 수 있습니다. 너의 선택.

행운을 빈다.