动态网页代码
图片无缝滚动代码
<table width="880" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="115" valign="middle"><div id=demo >
<table cellpadding=0 align=left border=1 cellspace="0" bordercolor="#ffffff">
<tr bordercolor="#FFFFFF">
<td id=demo11><table width='100%' cellpadding='0' cellspacing='2' border='0'>
<tr>
<td align='center'><a href="scml.asp" target="_blank"><a href='img/1.jpg'><img src='imgs/1.jpg' width='140' height='115' border="0"></a></td>
<td align='center'><a href="scml.asp" target="_blank"> <a href='img/2.jpg'><img src='imgs/2.jpg' width='140' height='115' border='0'></a></td>
<td align='center'><a target="_blank" href="scml.asp"> <a href='img/3.jpg'><img src='imgs/3.jpg' width='140' height='115' border='0'></a></td>
<td align='center'><a href="scml.asp" target="_blank"> <a href='img/4.jpg'><img src='imgs/4.jpg' width='140' height='115' border='0'></a></td>
<td align='center'><a href="scml.asp" target="_blank"> <a href='img/5.jpg'><img src='imgs/5.jpg' width='140' height='115' border='0'></a></td>
<td align='center'><a href="scml.asp" target="_blank"> <a href='img/6.jpg'><img src='imgs/6.jpg' width='140' height='115' border='0'></a></td>
</tr>
</table></td>
<td id=demo12></td>
</tr>
</table>
</div>
<SCRIPT>
var speed=15
demo12.innerHTML=demo11.innerHTML
function Marquee11(){
if(demo12.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo11.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar1=setInterval(Marquee11,speed)
</SCRIPT></td>
</tr>
</table>
时间代码
:
1
<div id="jnkc"></div>
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+'
星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script></div>
2
<SCRIPT language=JavaScript src="js/openfullwin.js"></SCRIPT>
3
<div id="jnkc" class="d12">
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script></div>
4.日期:
<div id="jnkc" class="d12">
<script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
</script></div>
5.显示日期
<script language="JavaScript" type="text/javascript">
today=new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六");
document.write(
"<font color=red style='font-size:10pt;font-family: 宋体'> ",
"今天是:",
Day()+1],
"
</font>" );
</script>
天气预报的代码
一、天气预报的代码:
<div align="center"><iframe src=" weather.265/weather.htm" width="160" height="60"
frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
二、天气预报的代码:
<div align="center"><iframe src=" weather.265/weather.htm" width="160" height="60"
frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
天气预报
<iframe src='weather.265/weather.htm' width='168' height='50' frameborder='0' marginwidth='0' marginheight='0' scrolling='no'></iframe>
新闻频道代码
新闻代码
<iframe border=0 name=I1 marginwidth=0
marginheight=0 src="news.sina/iframe/o/allnews/input/index.htm" frameborder=No
width=760 scrolling=no height=12></iframe>
一.新闻糸统
1.查询开始的代码
<%
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select top 6 * from news order by id desc"
rs.Open sql,conn,1,1
%>
2.循环开始代码
<%
if rs.EOF and rs.BOF then
response.write ("暂时还没有文章")
else
Do Until rs.EOF
%>
3.循环结束代码
<%
rs.MoveNext
Loop
end if
%>
4.查询结束代码
<%
rs.close
Set rs = Nothing
conn.close
set conn=Nothing
%>
******************************************************************************
二.新闻目录
1.循环开始代码
<%
Const MaxPerPage=18
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
set rs=server.CreateObject("dset")
sql="select * from news order by id"
html特效代码天气时钟rs.open sql,conn,1,1
a=1
if err.number<>0 then
response.write "数据库中无数据"
end if
f And rs.bof then
Response.Write "<p align='center' class='contents'> 暂没信息!</p>"
else
dcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"newsml.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"newsml.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"newsml.asp"
end if
end if
end if
sub showContent
dim i,j
i=0
%>
<% do while f %>
2.循环结束代码
<% i=i+1
j=j+1
if i>=MaxPerPage then Exit Do
if i mod 2= 0 then response.write("</tr><tr>")
loop
rs.close
set rs=nothing
%>
3.翻页执行代码
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ max
perpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<form method=Post action="&filename&">"
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首页 上一页</font> "
Else
Response.Write "<a href="&filename&"?page=1 class='contents'>首页</a> "
Response.Write "<a href="&filename&"?page="&CurrentPage-1&" class='contents'>上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下一页 尾页</font>"
Else
Response.Write "<a href="&filename&"?page="&(CurrentPage+1)&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?page="&n&" class='contents'>尾页</a>"
End If
Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "
Response.Write "<font class='contents'> 共有"&totalnumber&"个信息 "
Response.Write "<font class='contents'>转到:</font><input type='text' name='page' size=2 maxlength=10 class=smallInput value="¤tpage&">"
Response.Write " <input type='submit' class='button' value='GO' name='cndok'></form>"
End Function
%>
******************************************************************************
三.显示新闻的初始代码
<!--#include file="conn.asp" -->
<%
dim id
id=request.QueryString("id")
set rs=server.CreateObject("dset")
sql="select * from news where id="&id&""
rs.open sql,conn,1,1
%>
2.释放代码
<%
rs.close
set rs=nothing
conn.close
set conn=Nothing
%>

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。