漂亮的仿qq菜单

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>非常漂亮的类似QQ菜单的flash效果下拉菜单丨芯晴网页特效丨CsrCode.Cn</title>
<style type="text/css">
body{
 margin:10px;
 padding:10px;
}
body,td,div,span,li{
 font-size:12px;
}
.title01,.title02{
 color:#fff;
 font-weight:bold;
}
#DoorP{
 border:12px solid #eee;
 width:150px;
 height:300px;
 padding:4px;
 background:#fff;
}
.title01{
 width:100%;
 height:25px;
 background:#00ccff;
 cursor:pointer;
}
.title02{
 width:100%;
 height:25px;
 background:#99cc00;
 cursor:pointer;
}
.content{
 background:#eee;
 border-bottom:2px solid #fff;
 overflow:hidden;
 color:#666;
 padding-left:4px;
 padding-right:4px;
 line-height:18px;
}
</style>
<!--
棕:#eee;
蓝:#00ccff;
绿:#99cc00;
-->
</head>
<body>
<div id="DoorP">
 <table>
  <tr>
   <td>
     CsrCode.Cn
   </td>
  </tr>
 </table>
 <div class="content">
<li><a href="http://www.CsrCode.cn/html/txdm/">网页.特效</a></li>
<li><a href="http://www.CsrCode.cn/html/seo/">seo.优化</a></li>
<li><a href="http://Download.CsrCode.Cn/">源码.下载</a></li>
<li><a href="http://www.CsrCode.cn/html/mfkj/">免费.空间</a></li>
<li><a href="http://Links.CsrCode.Cn/">交换.链接</a></li>
<li><a href="http://www.CsrCode.cn/seotools/">收录.查询</a></li>
<li><a href="http://Shop.CsrCode.Cn/">芯晴淘宝站</a></li>
<li><a href="http://Changshi.CsrCode.Cn/">生活常识网</a></li>
<li><a href="http://www.CsrCode.cn/html/sucai/flashsucai/">透明flash</a></li>
 </div>
 <table>
  <tr>
   <td>
    网页特效①
   </td>
  </tr>
 </table>
 <div class="content">
<li><a href="http://www.CsrCode.cn/html/txdm/cddh/" title="">菜单导航特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/tcys/" title="">图层样式特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/ljwb/" title="">链接文本特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/txtx/" title="">图形图像特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/sbtx/" title="">鼠标特效代码</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/ymck/" title="">页面窗口特效</a></li>
 </div>
 <table>
  <tr>
   <td>
    网页特效②
   </td>
  </tr>
 </table>
 <div class="content">
<li><a href="http://www.CsrCode.cn/html/txdm/wybj/" title="">网页背景特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/rqsj/" title="">日期时间特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/ymss/" title="">页面搜索特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/bgtx/" title="">表格表单特效</a></li>
<li><a href="http://www.CsrCode.cn/html/txdm/qtdm/" title="">其他网页特效</a></li>
 </div>
</div>
<script type="text/javascript">
 var open = 2;// 设置初始打开的层序号
 var openState = new Array();
 var closeState = new Array();
 var dH = 220;
 function $(id){
  if(document.getElementById(id))
  {
   return document.getElementById(id);
  }
  else
  {
   alert("没有找到!");
  }
 }
 function $tag(id,tagName){
  return $(id).getElementsByTagName(tagName)
 }
 function closeMe(Cid,Oid){   
  var h = parseInt(Ds[Cid].style.height);
  //alert(h);
  if(h > 0)
  {
   h = h - Math.ceil(h/3);   
   Ds[Cid].style.height = h+"px";
  }
  else
  { 
  
   openMe(Oid);
   clearTimeout(closeState[Cid]);
   return false;
  }
  closeState[Cid] = setTimeout("closeMe("+Cid+","+Oid+")");
 }
 function openMe(Oid){
  var h = parseInt(Ds[Oid].style.height); 
  //alert(h);
  if(h < dH)
  {
   h = h + Math.ceil((dH-h)/3);   
   Ds[Oid].style.height = h+"px";
  }
  else
  { 
   clearTimeout(openState[Oid]);  
   return false;
  }
  openState[Oid] = setTimeout("openMe("+Oid+")");
 }
 var Ds = $tag("DoorP","div");
 var Ts = $tag("DoorP","table");
 if(Ds.length != Ts.length)
 {
  alert("标题和内容数目不相同!");
 }
 
 for(var i = 0 ; i < Ds.length ; i++)
 { 
  if(i==open)
  {
   Ds[i].style.height = dH+"px";
   Ts[i].className="title01";
  }
  else
  {
   Ds[i].style.height = "0px";
   Ts[i].className="title02";
  }
  Ts[i].value = i;
  Ts[i].onclick = function(){
   if(open==this.value)
   {
    return false;
   }
   Ts[open].className="title02";
   Ts[this.value].className="title01";
   for(var i = 0 ; i < openState.length ; i++)
   {
    clearTimeout(openState[i]);
    clearTimeout(closeState[i]);
   }
   closeMe(open,this.value);
   //openMe(this.value);
   open = this.value;
  }
 }
 //直接打开层函数
 function showDiv(id){ 
  Ds[id].style.height=dH+"px";
  Ds[open].style.height="0px";
  open = id;
 }
 //渐渐打开层函数
</script>
</body>
</html></font>

<p align="center">本特效由 <a href="http://www.csrcode.cn/" target="_blank">芯晴网页特效</a>丨CsrCode.Cn 收集于互联网,只为兴趣与学习交流,不作商业用途。</p>

posted on 2011-08-05 11:53  尹智玲  阅读(282)  评论(0编辑  收藏  举报

导航