<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/ 1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>javascript 显示隐藏TAB标签对象代码</title>
<script language="javascript">
function changetab_objdiv(event_obj,div_obj,now_i,total_num,the_class,other_class)
{
for(var i=1;i<=total_num;i++)
{
if(document.getElementById(event_obj+i))
{
var the_eobj=document.getElementById(event_obj+i);
if(now_i==i)
{
the_eobj.className=the_class;
}
else
{
if(other_class)
{
the_eobj.className=other_class;
}
else
{
the_eobj.className="";
}
}
}
if(document.getElementById(div_obj+i))
{
var item_obj=document.getElementById(div_obj+i);
if(now_i==i)
{
item_obj.style.display="";
}
else
{
item_obj.style.display="none";
}
}
}
}
</script>
<style type="text/css教程">
.ab{
background:#00FFFF;
}
.bc{
background:#990000;
}
</style>
</head>
<body>
<a href="#" onmouseover="javascript:changetab_objdiv('abc','abc',1,2,'ab','bc');">靠进我试一下</a>
<div id="abc">
</div>
</body>
</html>