CSS+JS TAB标签问题!!!
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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=utf-8" />
<title>无标题文档</title>
<style>
* {list-style-type:none; font-size:12px; text-decoration:none; margin:0; padding:0;}
.tab{ margin:20px; width:240px; height:200px; overflow:hidden; border:1px #AACCEE solid;}
.tab_b{ overflow:hidden; margin:5px; }
.menu {overflow:hidden; }
.menu li{ display:block; float:left; display: list-item; text-align:center; width:60px; background-color:#EDF4FC;line-height:20px; }
.menu li a{ display:block;}
</style>
</head>
<body>
<script language="javascript">
function tabs(m){
for(var id = 1;id<=4;id++)
{
var MrJin="tab_a"+id;
if(id==m)
document.getElementById(MrJin).style.display="block";
else
document.getElementById(MrJin).style.display="none";
}
if(m==1)
document.getElementById("").className="";
if(m==2)
document.getElementById("").className="";
if(m==3)
document.getElementById("").className="";
if(m==4)
document.getElementById("").className="";
}
</script>
<div class="tab">
<ul class="menu menu_bg" id="menutitle">
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(1)">新闻</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(2)">生活</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(3)">家居</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(4)">旅游</a></li>
</ul>
<div class="tab_b" id="tab_a1" style="display:block;"> 本地国内国际新闻<br />新浪</div>
<div class="tab_b" id="tab_a2" style="display:none;">网易 本土生活</div>
<div class="tab_b" id="tab_a3" style="display:none;">舒适居家房地产信息</div>
<div class="tab_b" id="tab_a4" style="display:none;">出行 度假</div>
</div>
</body>
</html>
js怎么样修改才能实现像msn http://cn.msn.com/ 那样的效果 鼠标经过标签背景颜色改变 还有就是给li标签加一个框 高手 改改!
下面这句js是什么意思?
if(m==1)
document.getElementById("menu").className="menu_g"; 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
* {list-style-type:none; font-size:12px; text-decoration:none; margin:0; padding:0;}
.tab{ margin:20px; width:240px; height:200px; overflow:hidden; border:1px #AACCEE solid;}
.tab_b{ overflow:hidden; margin:5px; }
.menu {overflow:hidden; }
.menu li{ display:block; float:left; display: list-item; text-align:center; width:60px; background-color:#EDF4FC;line-height:20px; }
.menu li a{ display:block;}
</style>
</head>
<body>
<script language="javascript">
function tabs(m){
for(var id = 1;id<=4;id++)
{
var MrJin="tab_a"+id;
if(id==m)
document.getElementById(MrJin).style.display="block";
else
document.getElementById(MrJin).style.display="none";
}
if(m==1)
document.getElementById("").className="";
if(m==2)
document.getElementById("").className="";
if(m==3)
document.getElementById("").className="";
if(m==4)
document.getElementById("").className="";
}
</script>
<div class="tab">
<ul class="menu menu_bg" id="menutitle">
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(1)">新闻</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(2)">生活</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(3)">家居</a></li>
<li><a href="javascript:void(0)" onmouseover="javascript:tabs(4)">旅游</a></li>
</ul>
<div class="tab_b" id="tab_a1" style="display:block;"> 本地国内国际新闻<br />新浪</div>
<div class="tab_b" id="tab_a2" style="display:none;">网易 本土生活</div>
<div class="tab_b" id="tab_a3" style="display:none;">舒适居家房地产信息</div>
<div class="tab_b" id="tab_a4" style="display:none;">出行 度假</div>
</div>
</body>
</html>
js怎么样修改才能实现像msn http://cn.msn.com/ 那样的效果 鼠标经过标签背景颜色改变 还有就是给li标签加一个框 高手 改改!
下面这句js是什么意思?
if(m==1)
document.getElementById("menu").className="menu_g"; 展开
展开全部
<head>
<title>无标题文档</title>
<style>
* {list-style-type:none; font-size:12px; text-decoration:none; margin:0; padding:0;}
.tab{ margin:20px; width:244px; height:200px; overflow:hidden; border:1px #AACCEE solid;}
.tab_b{ overflow:hidden; margin:5px; }
.menu {overflow:hidden; }
.menu li{ display:block; float:left; display: list-item; text-align:center; width:60px; background-color:#EDF4FC;line-height:20px; border-bottom:1px #AACCEE solid;border-right:1px #AACCEE solid; }
.menu li a{ display:block;}
.menu_d{border-bottom:1px #FFFFFF solid;background-color:#FFFFFF; }
.tab ul li.aaa
{
background:#FF0000;
}
</style>
</head>
<body>
<script language="javascript">
function tabs(n)
{
var len = 4;
for (var i = 1; i <= len; i++)
{
document.getElementById('tab_a' + i).style.display = (i == n) ? 'block' : 'none';
document.getElementById('tab_' + i).className = (i == n) ? 'aaa' : 'none';
}
}
var timeout;
function delayChangeTab(m, n)
{
timeout = setTimeout('tabs(' + m + ')', n);
}
function cancelChangeTab()
{
clearTimeout(timeout);
}
</script>
<div class="tab">
<ul class="menu" id="menutitle">
<li id="tab_1" class="aaa"><a href="javascript:void(0)" onmouseover="delayChangeTab('1',500);" onmouseout="cancelChangeTab();">新闻</a></li>
<li id="tab_2" ><a href="javascript:void(0)" onmouseover="delayChangeTab('2',500);" onmouseout="cancelChangeTab();">生活</a></li>
<li id="tab_3" ><a href="javascript:void(0)" onmouseover="delayChangeTab('3',500);" onmouseout="cancelChangeTab();">家居</a></li>
<li id="tab_4" ><a href="javascript:void(0)" onmouseover="delayChangeTab('4',500);" onmouseout="cancelChangeTab();">旅游</a></li>
</ul>
<div class="tab_b" id="tab_a1" style="display:block;"> 本地国内国际新闻<br />新浪</div>
<div class="tab_b" id="tab_a2" style="display:none;">网易 本土生活</div>
<div class="tab_b" id="tab_a3" style="display:none;">舒适居家房地产信息</div>
<div class="tab_b" id="tab_a4" style="display:none;">出行 度假</div>
</div>
</body>
<title>无标题文档</title>
<style>
* {list-style-type:none; font-size:12px; text-decoration:none; margin:0; padding:0;}
.tab{ margin:20px; width:244px; height:200px; overflow:hidden; border:1px #AACCEE solid;}
.tab_b{ overflow:hidden; margin:5px; }
.menu {overflow:hidden; }
.menu li{ display:block; float:left; display: list-item; text-align:center; width:60px; background-color:#EDF4FC;line-height:20px; border-bottom:1px #AACCEE solid;border-right:1px #AACCEE solid; }
.menu li a{ display:block;}
.menu_d{border-bottom:1px #FFFFFF solid;background-color:#FFFFFF; }
.tab ul li.aaa
{
background:#FF0000;
}
</style>
</head>
<body>
<script language="javascript">
function tabs(n)
{
var len = 4;
for (var i = 1; i <= len; i++)
{
document.getElementById('tab_a' + i).style.display = (i == n) ? 'block' : 'none';
document.getElementById('tab_' + i).className = (i == n) ? 'aaa' : 'none';
}
}
var timeout;
function delayChangeTab(m, n)
{
timeout = setTimeout('tabs(' + m + ')', n);
}
function cancelChangeTab()
{
clearTimeout(timeout);
}
</script>
<div class="tab">
<ul class="menu" id="menutitle">
<li id="tab_1" class="aaa"><a href="javascript:void(0)" onmouseover="delayChangeTab('1',500);" onmouseout="cancelChangeTab();">新闻</a></li>
<li id="tab_2" ><a href="javascript:void(0)" onmouseover="delayChangeTab('2',500);" onmouseout="cancelChangeTab();">生活</a></li>
<li id="tab_3" ><a href="javascript:void(0)" onmouseover="delayChangeTab('3',500);" onmouseout="cancelChangeTab();">家居</a></li>
<li id="tab_4" ><a href="javascript:void(0)" onmouseover="delayChangeTab('4',500);" onmouseout="cancelChangeTab();">旅游</a></li>
</ul>
<div class="tab_b" id="tab_a1" style="display:block;"> 本地国内国际新闻<br />新浪</div>
<div class="tab_b" id="tab_a2" style="display:none;">网易 本土生活</div>
<div class="tab_b" id="tab_a3" style="display:none;">舒适居家房地产信息</div>
<div class="tab_b" id="tab_a4" style="display:none;">出行 度假</div>
</div>
</body>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询