IE6中选项卡没有反应 为什么?

muxi1021 2012-07-24 10:30:52
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>

<!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 id="Head1" runat="server">
<title></title>
<script type="text/javascript">
function setTab(name, cursel, n) {
for (i = 1; i <= n; i++) {
var menu = document.getElementById(name + i);
var con = document.getElementById("con_" + name + "_" + i);
menu.className = i == cursel ? "hover" : "";
con.style.display = i == cursel ? "block" : "none";
}
}
</script>
<style type="text/css">
*
{
margin: 0px;
padding: 0px;
list-style: none;
}
.main
{
width: 700px;
height: 600px;
float: left;
display: inline;
padding: 3px;
background-color: Gray;
}
.main .menu
{
width: 306px;
height: 31px;
overflow: hidden;
float: left;
}
.main .menu span
{
width: 60px;
height: 30px;
line-height: 30px;
overflow: hidden;
text-align: center;
float: left;
margin: 1px 0 0 1px;
background-color: Yellow;
color: #BCBCBC;
font-weight: bold;
cursor: pointer;
font-size: 12px;
}
.main .menu .hover
{
background: #666;
color: #FFF;
}
.main .content
{
width: 700px;
height: 500px;
overflow: hidden;
float: left;
margin: 1px;
margin-top: 0px;
display: inline;
background-color: White;
}
.main .content div
{
width: 700px;
height: 500px;
color: Red;
font-weight: bold;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div class="main">
<div class="menu">
<span id="one1" onclick="setTab('one',1,2)" class="hover">选项卡1</span> <span id="one2"
onclick="setTab('one',2,2)">选项卡2</span>
</div>
<div class="content">
<div id="con_one_1">
内容一
</div>
<div id="con_one_2" style="display: none">
内容二</div>
</div>
</div>
</form>
</body>
</html>
...全文
123 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
muxi1021 2012-07-24
  • 打赏
  • 举报
回复
少了两个分号 于是 好了。。
孟子E章 2012-07-24
  • 打赏
  • 举报
回复
IE6测试没问题啊
编程有钱人了 2012-07-24
  • 打赏
  • 举报
回复
这段代码 我在IE下测试了 没问题啊

111,097

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧