好用的隐藏导航.html

<style  type="text/css">
<!--
body {
  font: normal 11px verdana;
  }
ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 150px; /* Width of Menu Items */
  border-bottom: 1px solid #ccc;
  }
  
ul li {
  position: relative;
  }
ul li a{
  position: relative;
  color:#3300FF;
  }
ul li a:hover{
  position: relative;
  color:#CC66FF
  }  
  
li ul {
  position: absolute;
  left: 149px; /* Set 1px less than menu width */
  top: 0;
  display: none;
  }
/* Styles for Menu Items */
ul li a {
  display: block;
  text-decoration: none;
  color: #777;
  background: #fff; /* IE6 Bug */
  padding: 5px;
  border: 1px solid #ccc; /* IE6 Bug */
  border-bottom: 0;
  }
  
/* Holly Hack. IE Requirement */
* html ul li { float: left; height: 1; }
* html ul li a { height: 1; }
/* End */
li:hover ul, li.over ul { display: block; color:#00CC66} /* The magic */
li.over ul li a{ color:#00FF00}
li.over ul li a:hover{ color:#FF0000}
-->
</style>
<script language="javascript">
// JavaScript Document
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+="over";
 }
 node.onmouseout=function() {
 this.className=this.className.replace("over", "");
 }
 }
 }
 }
}
window.onload=startList;
</script>
<UL id="nav">
<LI><A href="#">Home</A></LI>
<LI><A href="#">About</A> 
<UL>
<LI><A href="#">History</A></LI>
<LI><A href="#">Team</A></LI>
<LI><A href="#">Offices</A></LI></UL></LI>
<LI><A href="#">Services</A> 
<UL>
<LI><A href="#">Web Design</A></LI>
<LI><A href="#">Internet Marketing</A></LI>
<LI><A href="#">Hosting</A></LI>
<LI><A href="#">Domain Names</A></LI>
<LI><A href="#">Broadband</A></LI></UL></LI>
<LI><A href="#">Contact Us</A> 
<UL>
<LI><A href="#">United Kingdom</A></LI>
<LI><A href="#">France</A></LI>
<LI><A href="#">USA</A></LI>
<LI><A href="#">Australia</A></LI></UL></LI></UL>

 

by 雪洁 2010-05-24 22:42:46 3208 views
我来说几句

相关文章