肝胆相照论坛

 

 

肝胆相照论坛 论坛 电脑技术 存档 1 急求帮助!关于div中的代码
查看: 705|回复: 0

急求帮助!关于div中的代码 [复制链接]

Rank: 4

现金
512 元 
精华
帖子
33 
注册时间
2007-1-28 
最后登录
2013-11-20 
1
发表于 2007-2-14 01:43

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<title>WebForm3</title>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style>
body {font-size:12px;font-family:宋体}
ul.TabBarLevel1{
 list-style:none;
 margin:0;
 padding:0;
 height:29px;
 background-image:url(images/tabbar_level1_bk.gif);
}
ul.TabBarLevel1 li{
 float:left;
 padding:0;
 height:29px;
 margin-right:1px;
 background:url(images/tabbar_level1_slice_left_bk.gif) left top no-repeat;
}
ul.TabBarLevel1 li a{
 display:block;
 line-height:29px;
 padding:0 20px;
 color:#333;
 background:url(images/tabbar_level1_slice_right_bk.gif) right top no-repeat;
 white-space: nowrap;
}
ul.TabBarLevel1 li.Selected{
 background:url(images/tabbar_level1_slice_selected_left_bk.gif) left top no-repeat;
}
ul.TabBarLevel1 li.Selected a{
 background:url(images/tabbar_level1_slice_selected_right_bk.gif) right top no-repeat;
}

ul.TabBarLevel1 li a:link,ul.TabBarLevel1 li a:visited{
 color:#333;
}
ul.TabBarLevel1 li a:hover,ul.TabBarLevel1 li a:active{
 color:#F30;
 text-decoration:none;
}
ul.TabBarLevel1 li.Selected a:link,ul.TabBarLevel1 li.Selected a:visited{
 color:#000;
}
ul.TabBarLevel1 li.Selected a:hover,ul.TabBarLevel1 li.Selected a:active{
 color:#F30;
 text-decoration:none;
}
div.HackBox {
  padding : 2px 2px ;
  border-left: 2px solid #6697CD;
  border-right: 2px solid #6697CD;
  border-bottom: 2px solid #6697CD;
}
div.HackBox1 {
  padding : 2px 2px ;
  border-left: 2px solid #6697CD;
  border-right: 2px solid #6697CD;
  border-bottom: 2px solid #6697CD;
}
div.HackBox2 {
  padding : 2px 2px ;
  border-left: 2px solid #6697CD;
  border-right: 2px solid #6697CD;
  border-bottom: 2px solid #6697CD;
}
</style>

</head>
<body>
<div id="Whatever">
 <ul class="TabBarLevel1" id="TabPage1">
  <li id="Tab1" class="Selected"><a href="#" onclick="javascript:switchTab('TabPage1','Tab1');">课程信息</a></li>
  <li  id="Tab2"><a href="#" onclick="javascript:switchTab('TabPage1','Tab2');">已选课程</a></li>
  <li  id="Tab3"><a href="#" onclick="javascript:switchTab('TabPage1','Tab3');">学生信息</a></li>
  <li  id="Tab4"><a href="#" onclick="javascript:switchTab('TabPage1','Tab4');">修改密码</a></li>
  <li  id="Tab5"><a href="#" onclick="javascript:switchTab('TabPage1','Tab5');">查看成绩</a></li>
 </ul>
 <div class="HackBox" id="nihao" style=" overflow:auto width:100%;line-height:14pt;letter-spacing:0.2em;height:300px">  
 
   <form runat="server">
   <script language="vb" runat="server">
   Sub aa(ByVal sender As Object, ByVal e As EventArgs)
        Select Case dr.SelectedItem.Value
         Case "00"
         lbl.Text = "请输入"

         Case "01"
          lbl.Text = "请输入课程编号:"
         Case "02"
          lbl.Text = "请输入任课教师:"
         Case "03"
          lbl.Text = "请输入开课院系:"


         End Select
        End Sub
              </script>
        <aspropDownList ID="dr" runat="server" OnSelectedIndexChanged="aa">
          <aspistItem value="00">请选择查询字段</aspistItem>
          <aspistItem value="01">课程编号</aspistItem>
          <aspistItem value="02">任课教师</aspistItem>
          <asp:ListItem value="03">开课院系</asp:ListItem>
        </aspropDownList>
        <asp:Label ID="lbl" runat="server" />        
        <asp:TextBox ID="txtzd" runat="server" />       
        <asp:Button ID="Button" Text="查询" runat="server" />             
                        </form>
   <br>
  </div>
  <div class="HackBox1" id="nihao1"  style=" overflow:auto width:100%;line-height:14pt;letter-spacing:0.2em;height:300px">afklsdj</div>
  <div class="HackBox2" id="nihao2" style=" overflow:auto width:100%;line-height:14pt;letter-spacing:0.2em;height:300px">kkkk</div>
</div>
<script language="JavaScript">
//Switch Tab Effect
document.all["nihao1"].style.display ="none"
 document.all["nihao2"].style.display ="none"
function switchTab(tabpage,tabid){
        var oItem = document.getElementById(tabpage);  
 for(var i=0;i<oItem.children.length;i++){
  var x = oItem.children(i); 
  x.className = "";
  var y = x.getElementsByTagName('a');
  y[0].style.color="#333333";
 } 
 document.getElementById(tabid).className = "Selected";
 if(tabid=='Tab1')
 {document.all["nihao"].style.display =""
 document.all["nihao1"].style.display ="none"
 document.all["nihao2"].style.display ="none"}
  if(tabid=='Tab2')
 {document.all["nihao1"].style.display =""
 document.all["nihao2"].style.display ="none"
 document.all["nihao"].style.display ="none"}
  if(tabid=='Tab3')
  { document.all["nihao"].style.display ="none"
   document.all["nihao1"].style.display="none"
   document.all["nihao2"].style.display=""}
}


</script>
</body>
</html>
麻烦大家帮我看看,我想选择下拉列表框中的内容,标签里接着显示,结果标签不显示,得点按钮才显示

(2)我也不会在div中写代码,就是不知道怎么把数据库中的内容显示在div中,麻烦大家帮帮我!

‹ 上一主题|下一主题

肝胆相照论坛

GMT+8, 2024-11-23 08:45 , Processed in 0.014677 second(s), 11 queries , Gzip On.

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.