Php+js realize sina sliding Door effect code

Source: Internet
Author: User
Tags trim

<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"

"Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<style type= "Text/css" >
<!--

#header1 {
Background-color: #ffffff;
height:200px;
width:500px;
margin:0px;
padding:0px;
border:0px;
Font-family: "The song Body";
font-size:12px;
line-height:150%;
}
#menu1 {
margin:0px;
padding:0px;
List-style-type:none;
}
#menu1 Li {
Display:block;
width:100px;
Text-align:center;
Float:left;
margin:0px;
Padding-top:0.2em;
padding-right:0px;
Padding-bottom:0.2em;
padding-left:0px;
Cursor:hand;


}
#main1 Li
{
List-style-type:none;

}
. sec1 {background-color: #FFFFCC;}
. sec2 {background-color: #FEB97A;}
. block {Display:block;}
. unblock {Display:none}
a:link {COLOR: #000000; Text-decoration:none}
a:visited {COLOR: #000000; Text-decoration:none}
a:active {COLOR: #000000; Text-decoration:none}
a:hover {right:0px; COLOR: #ff0000; position:relative; top:1px; Text-decoration:

Underline}
-->
</style>
<%
function interceptstring (txt,length) ' intercepts characters according to Chinese and English characters
Txt=trim (TXT)
x = Len (TXT)
y = 0
If x >= 1 Then
For II = 1 to X
If ASC (Mid (txt,ii,1)) < 0 or ASC (Mid (txt,ii,1)) >255 then ' if it is kanji
y = y + 2
Else
y = y + 1
End If
If y >= length Then
txt = left (trim (TXT), ii) ' string length
Exit For
End If
Next
interceptstring = txt
Else
interceptstring = ""
End If

End Function

Dim

Conn,rs1,type1,mm_conn_string,rs2,type2,sql1,sql2,sql3,sql4,sql5,rs3,rs4,rs5,type3,type4,t

Ype5
mm_conn_string = "Driver={sql

Server};d atabase=sanxt;server=localhost;uid=sanxt;pwd=sanxt;
Set conn = Server.CreateObject ("ADODB. Connection ")
Conn.Open mm_conn_string
Set rs1=server.createobject ("Adodb.recordset")
type1= "Art Information"
sql1= "SELECT Top 7 id,caption,content,puttime from ccnews where classid= '" &trim (type1) & "'

ORDER BY id DESC "
Rs1.open sql1,conn,1,3

%>
<body>
<script language=javascript>
function SecBoard1 (n)

{

for (i=0;i<menu1.childnodes.length;i++)
Menu1.childnodes.classname= "SEC1";
Menu1.childnodes[n].classname= "SEC2";

for (i=0;i<main1.childnodes.length;i++)
Main1.childnodes.style.display= "None";
main1.childnodes[n].style.display= "Block";

}

</script>

<div id= "Header1" >
<ul id= "Menu1" >
<li onmouseover= "secBoard1 (0)" class= "SEC2" > Art information </li>
<li onmouseover= "SecBoard1 (1)" class= "SEC1" > Tibetan Exchange </li>
<li onmouseover= "SecBoard1 (2)" class= "SEC1" > Archaeological Discovery </li>
<li onmouseover= "SecBoard1 (3)" class= "SEC1" > Special news </li>
<li onmouseover= "SecBoard1 (4)" class= "SEC1" > Three Hidon News </li>
</ul>

<!--content display area-->

<ul id= "Main1" >
<li class= "Block" >
<%
Do as not rs1.eof
%>
<a href= ". /ZXZX/SHOWNEWS.ASP?ID=<%=RS1 ("id")%> "target=_blank><%=interceptstring" (rs1

("caption") & "..... ..... ..... ...... ..... ..... ..... ..... ..... ..... ...

></a> <%=formatdatetime (rs1 ("Puttime"), "2")%>
<BR/><%rs1.movenext
Loop
%></li><%
Rs1.close
Set rs1=nothing
%>

<li class= "unblock" ><%
Set rs2=server.createobject ("Adodb.recordset")
Type2= "The exchange of Tibetan family"
Sql2= "SELECT Top 7 id,caption,content,puttime from ccnews where classid= '" &trim

(type2) & "' ORDER BY id DESC"
Rs2.open sql2,conn,1,3
Do, not rs2.eof%> <a href= ". /ZXZX/SHOWNEWS.ASP?ID=<%=RS2 ("id")%> "

Target=_blank><%=interceptstring (RS2 ("caption")

& ".... .... .... .... .... .... .... .... .... .... .... ..... ..... ..... ..... ..... ..... ..... ..... <%

=formatdatetime (RS2 ("Puttime"), "2")%><br/>
<%rs2.movenext
Loop%></li>
<%rs2.close
Set rs2=nothing
%>

<li class= "unblock" ><%
Set rs3=server.createobject ("Adodb.recordset")
type3= "Archaeological Discoveries"
sql3= "SELECT Top 7 id,caption,content,puttime from ccnews where classid= '" &trim

(type3) & "' ORDER BY id DESC"
Rs3.open sql3,conn,1,3
Do, not rs3.eof%> <a href= ". /ZXZX/SHOWNEWS.ASP?ID=<%=RS3 ("id")%> "

Target=_blank><%=interceptstring (RS3 ("caption")

& ".... .... .... .... .... .... .... .... .... .... .... ..... ..... ..... ..... ..... ..... ..... ..... <%

=formatdatetime (RS3 ("Puttime"), "2")%><br/><%rs3.movenext
Loop%></li>
<%rs3.close
Set rs3=nothing
%>


<li class= "unblock" ><%
Set rs4=server.createobject ("Adodb.recordset")
type4= "website Bulletin"
sql4= "SELECT Top 7 id,caption,content,puttime from ccnews where classid= '" &trim

(type4) & "' ORDER BY id DESC"
Rs4.open sql4,conn,1,3
Do, not rs4.eof%> <a href= ". /ZXZX/SHOWNEWS.ASP?ID=<%=RS4 ("id")%> "

Target=_blank><%=interceptstring (RS4 ("caption")

& ".... .... .... .... .... .... .... .... .... .... .... ..... ..... ..... ..... ..... ..... ..... ..... <%

=formatdatetime (RS4 ("Puttime"), "2")%><br/><%rs4.movenext
Loop%></li>
<%rs4.close
Set rs4=nothing
%>

<li class= "unblock" ><%
Set rs5=server.createobject ("Adodb.recordset")
Type5= "Special News"
sql5= "SELECT Top 7 id,caption,content,puttime from ccnews where classid= '" &trim

(type5) & "' ORDER BY id DESC"
Rs5.open sql5,conn,1,3
Do, not rs5.eof%> <a href= ". /ZXZX/SHOWNEWS.ASP?ID=<%=RS5 ("id")%> "

Target=_blank><%=interceptstring (RS5 ("caption")

& ".... .... .... .... .... .... .... .... .... .... .... ..... ..... ..... ..... ..... ..... ..... ..... <%

=formatdatetime (RS5 ("Puttime"), "2")%><br/><%rs5.movenext
Loop%></li>
<%rs5.close
Set rs5=nothing
%>
</ul>
<!--content display area-->
</div>

</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.