0
我做了一個下拉菜單,並按照標準,當你懸停在菜單項上,你會得到一個項目的下拉選擇。獲取下拉菜單以顯示onfocus?
我曾經讓他們顯示在懸停的代碼是:
#header .navWrapper .nav li:hover > ul.sub {
display: block;
}
我在想,反正是有讓他們沒有JavaScript顯示聚焦狀態?
我試過,但它沒有工作..
#header .navWrapper .nav li:hover > ul.sub,
#header .navWrapper .nav li:focus > ul.sub
{
display: block;
}
HTML代碼:
<div class="navWrapper">
<div class="left"></div>
<div class="nav">
<ul>
<li class="home"><a href="/">Home</a></li>
<li class="spacer"></li>
<li class="about">
<a href="about_us/">About Us</a>
<ul class="sub">
<li><a href="">option 1</a></li>
</ul>
</li>
<!-- About Ends -->
<li class="spacer"></li>
<li class="trademark"><a href="freetrademarksearch/">Free Trademark Search</a></li>
<li class="spacer"></li>
<li class="services">
<a href="services/">Services</a>
<ul class="sub">
<li><a href="">option 1</a></li>
<li><a href="">option 2</a></li>
</ul>
<!-- Sub Ends -->
</li>
<!-- Services Ends -->
<li class="spacer"></li>
<li class="testimonials"><a href="testimonials/">Testimonials</a></li>
<li class="spacer"></li>
<li class="more">
<a href="javascript:void(0);">More Information</a>
<ul class="sub">
<li><a href="">option 1</a></li>
<li><a href="">option 2</a></li>
</ul>
<!-- Sub Ends -->
</li>
<li class="spacer"></li>
<li class="contact"><a href="contact-us/">Contact Us</a></li>
</ul>
<div class="contentClear"></div>
</div>
<!-- Nav Ends -->
<div class="right"></div>
</div>
<!-- Nav Wrapper Ends -->
你能告訴我們也是html代碼嗎? – 2012-08-09 07:35:39
現在加入;) – Brett 2012-08-09 07:49:06