<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
li{
background:#555000;
background-repeat: repeat-x;
}
li.show ul li{
background:#ffffff;
background-repeat: repeat-x;
}
li.show ul li.show ul li{
background:#FF0555;
background-repeat: repeat-x;
}
.quick_menu{
width:auto;
margin:0px auto;
font-size: 13px;
}
.quick_menu ul{
margin:0px;padding:0px;list-style:none;
}
.quick_menu ul li{
float:left;width:100px;text-align:center;line-height:30px; position:relative; height:30px;
}
.quick_menu ul li ul{
position:absolute; left:0px; top:30px; display:none;
}
.quick_menu ul li.show ul {
display:block;top:30px;left:0px;
}
.quick_menu div{
color:white;
}
.quick_menu ul li.show div{
background:#000000;font-weight:bold;color:black;
}
.quick_menu ul li.show ul li.show div{
background:#ffffff;color:#000000;
}
</style>
<script src="jquery-1.2.6.js"></script>
<script language="javascript" type="text/javascript">
function getid(id){return document.getElementById(id);}
function gettag(tag,obj){if(obj){return obj.getElementsByTagName(tag)}else{return document.getElementsByTagName(tag)}}
function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!="function"){
window.onload=func;
}else{
window.onload=function(){
oldonload();func();
}
};
}
function menu(){
var menu=getid("menu");
var li=gettag("li",menu);
for(var i=0;i<li.length;i++){
li[i].onmouseover=function(){
if(this.className.indexOf("show")<0)
{
$(this).addClass("show");
}
}
li[i].onmouseout=function(){
$(this).removeClass("show");
}
}
}
addLoadEvent(menu);
</script>
<div class="quick_menu">
<ul id="menu" >
<li>
<div class="quick_menu">菜单一</div>
<ul>
<li>
<div>一一</div>
</li>
<li>
<div>一二</div>
</li>
<li>
<div>一三</div>
</li>
</ul>
</li>
<li>
<div>菜单二</div>
<ul>
<li>
<div>二一</div>
</li>
<li>
<div>二二</div>
</li>
<li>
<div>二三</div>
</li>
</ul>
</li>
</ul>
</div>