<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css滑动门</title>
<style type="text/css">
.div1{
 height:30px;
 width:80px;
 float:left;
 background-color:red;
 font-size:14px;
 line-height:30px;
 text-align:center;
 color:black;
 cursor:pointer;
}
.div2{
 height:30px;
 width:80px;
 float:left;
 background-color:blue;
 font-size:14px;
 line-height:30px;
 text-align:center;
 color:white;
 font-weight:bold;
 border-left:1px solid #003399;
 cursor:pointer;
}
.dv1{
 height:300px;
 width:323px;
 float:left;
 background-color:#3399CC;
 font-size:14px;
 color:red;
 display:block;
 line-height:300px;
 text-align:center;
}
.dv2{
 height:300px;
 width:323px;
 float:left;
 font-size:14px;
 color:black;
 display:none;
 line-height:300px;
 text-align:center;
 background-color:#CCCCCC;
}
.all{
 height:30px;
 width:1003px;
 margin:auto;
}
</style>
<script language="javascript">
function changebg(o){
return document.getElementById(o);
}
function changebg1(n){
for(var i=1;i<=4;i++){
 changebg('dd'+i).className='div2';
 changebg('d'+i).className='dv2';
 }
 changebg('dd'+n).className='div1';
 changebg('d'+n).className='dv1';
}
</script>
</head>
<body>
<div class="all">
<div id="dd1" class="div1" onmouseover="javascript:changebg1(1)">菜单一</div>
<div id="dd2" class="div2" onmouseover="javascript:changebg1(2)">菜单二</div>
<div id="dd3" class="div2" onmouseover="javascript:changebg1(3)">菜单三</div>
<div id="dd4" class="div2" onmouseover="javascript:changebg1(4)">菜单四</div>
</div>
<div id="d1" class="dv1">koyka  欢迎进入陈凯凯的BLOG;</div>
<div id="d2" class="dv2">benimaru 欢迎进入陈凯凯的BLOG;</div>
<div id="d3" class="dv2">welcome 欢迎进入陈凯凯的BLOG;</div>
<div id="d4" class="dv2"> Thankyou 欢迎进入陈凯凯的BLOG;</div>
</body>
</html>
posted on 2008-11-04 14:47  陈凯凯  阅读(6996)  评论(0)    收藏  举报