![]() |
#2
孤独冷雨2010-01-04 14:06
![]() <script language="javascript"> <!-- function MM_showHideLayers() { //v9.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } //--> </script> 加入到head之间 主体部分 把这些放在一个TD里就是你要的效果了: ![]() <!--*招商,招标,合作--> <div id="div1" style="position:absolute;width:378px; height:274px; visibility: visible; z-index: 0; "> <table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="36"><table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="91" height="36" align="center" valign="middle"><a href="../xm/index.asp?durge=0" target="_blank"><img src="images/right7_1_1.jpg" width="91" height="36" border="0"></a></td> <td width="87" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','hide','div2','','show','div3','','hide')"><img src="images/right7_1_2.jpg" width="87" height="36" border="0"></td> <td width="87" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','hide','div2','','hide','div3','','show')"><img src="images/right7_1_3.jpg" width="87" height="36"></td> <td width="113" height="36" align="right" valign="middle" background="images/right7_1_4.jpg"><a href="/xm/index.asp?durge=0">更多>></a> </td> </tr> </table> </td> </tr> <tr> <td height="237" align="center" valign="top" background="images/right_bj4.jpg"> <table width="370" border="0" cellspacing="0" cellpadding="0"> <% Set rs= Server.CreateObject("ADODB.Recordset") sql="select top 9 * from xiangmu where lock=0 and hot=1 and durge=0 order by edit_time desc ,uptime desc" rs.open sql,conn,1,1 if rs.eof then response.Write "<tr><td height='30' align='center'>暂无内容</td></tr>" else for i=1 to 9 %> <tr> <td width="45" height="26" align="center">[招商]</td> <td align="left" valign="middle"><a href="../com_show/pj_show_one.asp?com_id=<%=rs("userid")%>&pj_id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><% if len(trim(rs("title")))>22 then response.Write left(rs("title"),20)&"…" else response.Write rs("title") end if %></a></td> <td width="55" height="26" align="center"><%=month(rs("edit_time"))&"-"&day(rs("edit_time"))%></td> </tr> <% rs.movenext if rs.eof then exit for next end if rs.close set rs=nothing %> </table> </td> </tr> <tr> <td height="1" bgcolor="#D1D1D1"></td> </tr> </table> </div> <!--*招商 结束,招标,合作--> <!--招商,*招标,合作--> <div id="div2" style="position:absolute;width:378px; height:274px; visibility: hidden; z-index: 0; "> <table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="36"><table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="91" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','show','div2','','hide','div3','','hide')"><img src="images/right7_2_1.jpg" width="91" height="36"></td> <td width="87" height="36" align="center" valign="middle"><a href="../xm/index.asp?durge=1" target="_blank"><img src="images/right7_2_2.jpg" width="87" height="36" border="0"></a></td> <td width="87" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','hide','div2','','hide','div3','','show')"><img src="images/right7_2_3.jpg" width="87" height="36"></td> <td width="113" height="36" align="right" valign="middle" background="images/right7_1_4.jpg"><a href="../xm/index.asp?durge=1">更多>></a> </td> </tr> </table> </td> </tr> <tr> <td height="237" align="center" valign="top" background="images/right_bj4.jpg"> <table width="370" border="0" cellspacing="0" cellpadding="0"> <% Set rs= Server.CreateObject("ADODB.Recordset") sql="select top 9 * from xiangmu where lock=0 and hot=1 and durge=1 order by edit_time desc ,uptime desc" rs.open sql,conn,1,1 if rs.eof then response.Write "<tr><td height='30' align='center'>暂无内容</td></tr>" else for i=1 to 9 %> <tr> <td width="45" height="26" align="center">[招标]</td> <td align="left" valign="middle"><a href="../com_show/pj_show_one.asp?com_id=<%=rs("userid")%>&pj_id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><% if len(trim(rs("title")))>22 then response.Write left(rs("title"),20)&"…" else response.Write rs("title") end if %></a></td> <td width="55" height="26" align="center"><%=month(rs("edit_time"))&"-"&day(rs("edit_time"))%></td> </tr> <% rs.movenext if rs.eof then exit for next end if rs.close set rs=nothing %> </table> </td> </tr> <tr> <td height="1" bgcolor="#D1D1D1"></td> </tr> </table> </div> <!--招商,*招标 结束,合作--> <!--招商,招标,*合作--> <div id="div3" style="position:absolute;width:378px; height:274px; visibility: hidden; z-index: 0; "> <table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="36"><table width="378" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="91" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','show','div2','','hide','div3','','hide')"><img src="images/right7_3_1.jpg" width="91" height="36"></td> <td width="87" height="36" align="center" valign="middle" onMouseOver="MM_showHideLayers('div1','','hide','div2','','show','div3','','hide')"><img src="images/right7_3_2.jpg" width="87" height="36"></td> <td width="87" height="36" align="center" valign="middle"><a href="../xm/index.asp?durge=3" target="_blank"><img src="images/right7_3_3.jpg" width="87" height="36" border="0"></a></td> <td width="113" height="36" align="right" valign="middle" background="images/right7_1_4.jpg"><a href="../xm/index.asp?durge=3">更多>></a> </td> </tr> </table> </td> </tr> <tr> <td height="237" align="center" valign="top" background="images/right_bj4.jpg"> <table width="370" border="0" cellspacing="0" cellpadding="0"> <% Set rs= Server.CreateObject("ADODB.Recordset") sql="select top 9 * from xiangmu where lock=0 and hot=1 and durge=3 order by edit_time desc ,uptime desc" rs.open sql,conn,1,1 if rs.eof then response.Write "<tr><td height='30' align='center'>暂无内容</td></tr>" else for i=1 to 9 %> <tr> <td width="45" height="26" align="center">[合作]</td> <td align="left" valign="middle"><a href="../com_show/pj_show_one.asp?com_id=<%=rs("userid")%>&pj_id=<%=rs("id")%>" target="_blank" title="<%=rs("title")%>"><% if len(trim(rs("title")))>22 then response.Write left(rs("title"),20)&"…" else response.Write rs("title") end if %></a></td> <td width="55" height="26" align="center"><%=month(rs("edit_time"))&"-"&day(rs("edit_time"))%></td> </tr> <% rs.movenext if rs.eof then exit for next end if rs.close set rs=nothing %> </table> </td> </tr> <tr> <td height="1" bgcolor="#D1D1D1"></td> </tr> </table> </div> <!--招商,招标,*合作 结束--> |

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>滑动门</title>
<style media="screen" type="text/css">
<!--
*{font-size:12px;}
html,body{margin:0;text-align:left;over-flow:hidden;height:100%;width:100%;}
UL{list-style-type:none; margin:0px;}
.ttl{height:18px;}
.ctt{
height:auto;
padding:6px;
clear:both;
border: 1px solid #CCCCCC;
}
.w936{
width:380px;
clear:both;
height: 120px;
margin-top: 20px;
margin-right: 0;
margin-bottom: 2px;
margin-left: 0;
}
.normaltab {
color:#1F3A87;
}
.hovertab {
color:#FF0000;
background-color: #99CC00;
}
.dis{display:block;}
.undis{display:none;}
.tabs {
width:100%;
background:#BBD9EE;
font-size:93%;
line-height:normal;
}
.tabs ul {
margin:0;
padding:10px 10px 0 0px;
list-style:none;
}
.tabs li {
display:inline;
margin:0;
padding:0;
cursor: pointer;
}
.tabs a {
float:left;
background:url
("http://hiphotos.baidu.com/lijiping/pic/item/312c793e42646d2d70cf6cdd.
jpg") no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
.tabs a span {
float:left;
display:block;
background:url
("http://hiphotos.baidu.com/lijiping/pic/item/2d5983351541430190ef398d.
jpg") no-repeat right top;
padding:5px 15px 4px 6px;
color:#666;
}
.tabs a span {float:none;}
.tabs a:hover span {
color:#FF9834;
}
.tabs a:hover {
background-position:0% -42px;
}
.tabs a:hover span {
background-position:100% -42px;
}
-->
</style>
<script type="text/javascript" language="javascript">
<!--
function g(o){return document.getElementById(o);}
function HoverLi(n)
{
for(var i=1;i<=3;i++){g('tb_'+i);g('tbc_0'+i).className='undis';}
g('tbc_0'+n).className='dis';g('tb_'+n);
}
//-->
</script>
</head>
<body>
<div class="w936">
<div id="tb_" class="tb_ tabs">
<ul>
<li id="tb_1" onmouseover="HoverLi(1);"><a href="#"><span>栏目导航1
</span></a></li>
<li id="tb_2" onmouseover="HoverLi(2);"><a href="#"><span>栏目导航2
</span></a></li>
<li id="tb_3" onmouseover="HoverLi(3);"><a href="#"><span>栏目导航3
</span></a></li>
</ul>
</div>
<div class="ctt">
<div class="dis" id="tbc_01">内容1</div>
<div class="undis" id="tbc_02">内容2</div>
<div class="undis" id="tbc_03">内容3</div>
</div>
</div>
</div>
</div>
</body>
</html>
现在我要调用数据库,把上面的内容改成从数据库中调用内容显示。"http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>滑动门</title>
<style media="screen" type="text/css">
<!--
*{font-size:12px;}
html,body{margin:0;text-align:left;over-flow:hidden;height:100%;width:100%;}
UL{list-style-type:none; margin:0px;}
.ttl{height:18px;}
.ctt{
height:auto;
padding:6px;
clear:both;
border: 1px solid #CCCCCC;
}
.w936{
width:380px;
clear:both;
height: 120px;
margin-top: 20px;
margin-right: 0;
margin-bottom: 2px;
margin-left: 0;
}
.normaltab {
color:#1F3A87;
}
.hovertab {
color:#FF0000;
background-color: #99CC00;
}
.dis{display:block;}
.undis{display:none;}
.tabs {
width:100%;
background:#BBD9EE;
font-size:93%;
line-height:normal;
}
.tabs ul {
margin:0;
padding:10px 10px 0 0px;
list-style:none;
}
.tabs li {
display:inline;
margin:0;
padding:0;
cursor: pointer;
}
.tabs a {
float:left;
background:url
("http://hiphotos.baidu.com/lijiping/pic/item/312c793e42646d2d70cf6cdd.
jpg") no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
.tabs a span {
float:left;
display:block;
background:url
("http://hiphotos.baidu.com/lijiping/pic/item/2d5983351541430190ef398d.
jpg") no-repeat right top;
padding:5px 15px 4px 6px;
color:#666;
}
.tabs a span {float:none;}
.tabs a:hover span {
color:#FF9834;
}
.tabs a:hover {
background-position:0% -42px;
}
.tabs a:hover span {
background-position:100% -42px;
}
-->
</style>
<script type="text/javascript" language="javascript">
<!--
function g(o){return document.getElementById(o);}
function HoverLi(n)
{
for(var i=1;i<=3;i++){g('tb_'+i);g('tbc_0'+i).className='undis';}
g('tbc_0'+n).className='dis';g('tb_'+n);
}
//-->
</script>
</head>
<body>
<div class="w936">
<div id="tb_" class="tb_ tabs">
<ul>
<li id="tb_1" onmouseover="HoverLi(1);"><a href="#"><span>栏目导航1
</span></a></li>
<li id="tb_2" onmouseover="HoverLi(2);"><a href="#"><span>栏目导航2
</span></a></li>
<li id="tb_3" onmouseover="HoverLi(3);"><a href="#"><span>栏目导航3
</span></a></li>
</ul>
</div>
<div class="ctt">
<div class="dis" id="tbc_01">内容1</div>
<div class="undis" id="tbc_02">内容2</div>
<div class="undis" id="tbc_03">内容3</div>
</div>
</div>
</div>
</div>
</body>
</html>
数据库conn.asp
将下面代码改成滑动门效果,内容调用数据库,请问该如何更改呢,高手们指导下。谢谢!

<table width="380" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" height="30" valign="top">栏目导航1 栏目导航2 栏目导航3</td>
</tr>
<tr>
<td colspan="2">
<%
dim m
m=9
set rs_news=server.createobject("adodb.recordset")
sqltext4="select * from news order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
</td>
</tr>
<%i=0
do while not rs_news.eof%>
<%if rs_news("showtitle")=false then%>
<tr>
<td width="20" height="20"><img src="images/tb/arrow_4.gif" width="12" height="11"></td>
<td width="360" style='BORDER-bottom: #999999 1px dotted'>
<div align="left">
<p style='line-height:150%'> <%if rs_news("Okhref")=false then%>
<%if rs_news("page")=false then%>
<a href="shownews.asp?id=<%=rs_news("id")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%else%>
<a href="shownews1.asp?id=<%=rs_news("id")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%end if%>
<%else%>
<a href="<%=rs_news("href")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%end if%>
<%if rs_news("AddDate")=date() then%>
<font color="red"><%=cutstr(rs_news("title"),25)%></font>
<%else%>
<%=cutstr(rs_news("title"),25)%>
<%end if%></a>
</div>
</td>
</tr>
<%end if%>
<%
m=m-1
if m<1 then exit do
rs_news.movenext
i=i+1
loop
rs_news.close %>
<tr>
<td colspan="2"><div align="right"><a href="NewsClass.asp?BigClass=公司新闻" target="_blank">更多</a></div></td>
</tr>
</table>
<tr>
<td colspan="2" height="30" valign="top">栏目导航1 栏目导航2 栏目导航3</td>
</tr>
<tr>
<td colspan="2">
<%
dim m
m=9
set rs_news=server.createobject("adodb.recordset")
sqltext4="select * from news order by AddDate desc"
rs_news.open sqltext4,conn,1,1
%>
</td>
</tr>
<%i=0
do while not rs_news.eof%>
<%if rs_news("showtitle")=false then%>
<tr>
<td width="20" height="20"><img src="images/tb/arrow_4.gif" width="12" height="11"></td>
<td width="360" style='BORDER-bottom: #999999 1px dotted'>
<div align="left">
<p style='line-height:150%'> <%if rs_news("Okhref")=false then%>
<%if rs_news("page")=false then%>
<a href="shownews.asp?id=<%=rs_news("id")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%else%>
<a href="shownews1.asp?id=<%=rs_news("id")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%end if%>
<%else%>
<a href="<%=rs_news("href")%>" target="_blank"
title="标题:<%=rs_news("title")%>
更新时间:<%=rs_news("AddDate")%>">
<%end if%>
<%if rs_news("AddDate")=date() then%>
<font color="red"><%=cutstr(rs_news("title"),25)%></font>
<%else%>
<%=cutstr(rs_news("title"),25)%>
<%end if%></a>
</div>
</td>
</tr>
<%end if%>
<%
m=m-1
if m<1 then exit do
rs_news.movenext
i=i+1
loop
rs_news.close %>
<tr>
<td colspan="2"><div align="right"><a href="NewsClass.asp?BigClass=公司新闻" target="_blank">更多</a></div></td>
</tr>
</table>