| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1809 人关注过本帖
标题:DIV+CSS滑动门怎么读取数据库的内容
只看楼主 加入收藏
fjhtf
Rank: 1
等 级:新手上路
帖 子:83
专家分:0
注 册:2006-4-29
结帖率:46.67%
收藏
已结贴  问题点数:10 回复次数:3 
DIV+CSS滑动门怎么读取数据库的内容
这个是滑动门的代码:
程序代码:
<!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>
现在我要调用数据库,把上面的内容改成从数据库中调用内容显示。
数据库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>




 
搜索更多相关主题的帖子: 数据库 DIV 滑动 CSS 
2010-01-04 13:47
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1247
专家分:1909
注 册:2007-6-4
收藏
得分:5 

程序代码:
<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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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>&nbsp;&nbsp;</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> 
   <!--招商,招标,*合作 结束-->       


这里有男女系列成人用品,有时间兄弟们来看一看.
51za.
2010-01-04 14:06
fjhtf
Rank: 1
等 级:新手上路
帖 子:83
专家分:0
注 册:2006-4-29
收藏
得分:0 
还是不理解,版主能帮我改下那个代码吗?

宏星电脑医生http://www.
全国淘宝充值旗舰店http://czpt8./
2010-01-04 14:18
aspic
Rank: 17Rank: 17Rank: 17Rank: 17Rank: 17
等 级:贵宾
威 望:51
帖 子:2258
专家分:8050
注 册:2008-2-18
收藏
得分:5 
你不"滑动门"的时候怎么调用还是怎么调用 现在不过是把不需要的隐藏而已
2010-01-04 15:58
快速回复:DIV+CSS滑动门怎么读取数据库的内容
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017330 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved