在div中我设置了 style="display:none"为什么隐藏不了 10
div中我用repeater控件显示了左右各10条数据。我想做成滑动门效果。可是div却隐藏不住,两个div中的数据都显示出来了。请高手指教!!!!!...
div中我用repeater控件显示了左右各10条数据。我想做成滑动门效果。可是div却隐藏不住,两个div中的数据都显示出来了。请高手指教!!!!!
展开
3个回答
展开全部
<!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 runat="server">
<title>漂亮淡蓝色滑动门代码</title>
<style type="text/css">
body
{
font-size:12px;
}
.normal
{
list-style: none; float: left;
padding: 5px 2px 2px 2px;
width: 90px; text-align :center ;
vertical-align :middle ;
cursor :pointer ;
border-bottom :solid 1px #9cd9f5;
border-right :solid 1px #9cd9f5;
background-color: #dee7f5;
border-collapse :separate ;
}
.selected
{
list-style: none;
float: left;
padding: 5px 2px 2px 2px;
width: 90px;
text-align :center ;
vertical-align :middle ;
cursor :pointer ;
border-bottom :solid 0px #9cd9f5;
border-right :solid 1px #9cd9f5;
background-color:#f8f8f8 ;
}
#divMainTab
{
border-left :solid 1px #9cd9f5;
border-top :solid 1px #9cd9f5;
float:left;
margin: 0px; padding: 0px
}
.divContent
{
width: 474px;
height: 400px;
clear: both;
border-bottom: solid 1px #9cd9f5;
border-left: solid 1px #9cd9f5;
border-right: solid 1px #9cd9f5;
}
a{
text-decoration: none;
color: #00ccff;
}
a:hover
{
text-decoration: underline;
color: #cc0000;
}
</style>
<script language="javascript" type="text/javascript">
function changeTab(index)
{
for (var i=1;i<=5;i++)
{
document.getElementById ("li_"+i).className ="normal";
document.getElementById ("li_"+index).className ="selected";
document.getElementById ("div"+i).style.display ="none";
}
document.getElementById ("div1").innerText= "www.codefans.net"+index;
document.getElementById ("div"+index).style.display ="block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="divMainTab">
<ul style="list-style: none; margin: 0px; padding: 0px; border-collapse: collapse;">
<li id="li_1" class="selected" onmouseover="changeTab('1')"><a href="#">最新更新</a> </li>
<li id="li_2" class="normal" onmouseover="changeTab('2')"><a href="#">阅读排行</a> </li>
<li id="li_3" class="normal" onmouseover="changeTab('3')"><a href="#">本月排行</a> </li>
<li id="li_4" class="normal" onmouseover="changeTab('4')"><a href="#">本日排行</a> </li>
<li id="li_5" class="normal" onmouseover="changeTab('5')"><a href="#">源码爱好者</a> </li>
</ul>
</div>
<div id="div1" style ="display :block" class ="divContent">
1号
</div>
<div id="div2" style ="display :none" class ="divContent">
2号
</div>
<div id="div3" style ="display :none" class ="divContent">
3号
</div>
<div id="div4" style ="display :none" class ="divContent">
4号
</div>
<div id="div5" style ="display :none" class ="divContent">
5号
</div>
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>漂亮淡蓝色滑动门代码</title>
<style type="text/css">
body
{
font-size:12px;
}
.normal
{
list-style: none; float: left;
padding: 5px 2px 2px 2px;
width: 90px; text-align :center ;
vertical-align :middle ;
cursor :pointer ;
border-bottom :solid 1px #9cd9f5;
border-right :solid 1px #9cd9f5;
background-color: #dee7f5;
border-collapse :separate ;
}
.selected
{
list-style: none;
float: left;
padding: 5px 2px 2px 2px;
width: 90px;
text-align :center ;
vertical-align :middle ;
cursor :pointer ;
border-bottom :solid 0px #9cd9f5;
border-right :solid 1px #9cd9f5;
background-color:#f8f8f8 ;
}
#divMainTab
{
border-left :solid 1px #9cd9f5;
border-top :solid 1px #9cd9f5;
float:left;
margin: 0px; padding: 0px
}
.divContent
{
width: 474px;
height: 400px;
clear: both;
border-bottom: solid 1px #9cd9f5;
border-left: solid 1px #9cd9f5;
border-right: solid 1px #9cd9f5;
}
a{
text-decoration: none;
color: #00ccff;
}
a:hover
{
text-decoration: underline;
color: #cc0000;
}
</style>
<script language="javascript" type="text/javascript">
function changeTab(index)
{
for (var i=1;i<=5;i++)
{
document.getElementById ("li_"+i).className ="normal";
document.getElementById ("li_"+index).className ="selected";
document.getElementById ("div"+i).style.display ="none";
}
document.getElementById ("div1").innerText= "www.codefans.net"+index;
document.getElementById ("div"+index).style.display ="block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="divMainTab">
<ul style="list-style: none; margin: 0px; padding: 0px; border-collapse: collapse;">
<li id="li_1" class="selected" onmouseover="changeTab('1')"><a href="#">最新更新</a> </li>
<li id="li_2" class="normal" onmouseover="changeTab('2')"><a href="#">阅读排行</a> </li>
<li id="li_3" class="normal" onmouseover="changeTab('3')"><a href="#">本月排行</a> </li>
<li id="li_4" class="normal" onmouseover="changeTab('4')"><a href="#">本日排行</a> </li>
<li id="li_5" class="normal" onmouseover="changeTab('5')"><a href="#">源码爱好者</a> </li>
</ul>
</div>
<div id="div1" style ="display :block" class ="divContent">
1号
</div>
<div id="div2" style ="display :none" class ="divContent">
2号
</div>
<div id="div3" style ="display :none" class ="divContent">
3号
</div>
<div id="div4" style ="display :none" class ="divContent">
4号
</div>
<div id="div5" style ="display :none" class ="divContent">
5号
</div>
</div>
</form>
</body>
</html>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
又没代码 汗叫人怎么解决啊 display:none 无效 不大可能
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把你的代码贴上来吧这样谁看得出哦
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询