完整的动态网页代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

完整的动态网页代码,图片无缝滚动代码
<table width="880" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="115" valign="middle"><div id=demo style="OVERFLOW: hidden; WIDTH: 100%; HEIGHT: 115px">
<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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">&nbsp;<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)
demo.onmouseover=function() {clearInterval(MyMar1)}
demo.onmouseout=function() {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: 宋体'> ",
"今天是:",
today.getYear(),"年",
today.getMonth()+1,"月",
today.getDate(),"日",
d[today.getDay()+1],
"</font>" );
</script>
天气预报的代码
一、天气预报的代码:
<div align="center"><iframe src=" /weather.htm" width="160" height="60"
frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
二、天气预报的代码:
<div align="center"><iframe src=" /weather.htm" width="160" height="60"
frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
天气预报
<iframe src='/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="/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("adodb.recordset")
sql="select * from news order by id"
rs.open sql,conn,1,1
a=1
if err.number<>0 then
response.write "数据库中无数据"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 暂没信息!</p>"
else
totalPut=rs.recordcount
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 rs.move (currentPage-1)*MaxPerPage
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 not rs.eof %>
2.循环结束代码
<% i=i+1
j=j+1
if i>=MaxPerPage then Exit Do
if i mod 2= 0 then response.write("</tr><tr>") rs.movenext
loop
rs.close
set rs=nothing
%>
3.翻页执行代码
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
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="&currentpage&">"
Response.Write "&nbsp;<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("adodb.recordset")
sql="select * from news where id="&id&"" rs.open sql,conn,1,1
%>
2.释放代码
<%
rs.close
set rs=nothing
conn.close
set conn=Nothing
%>。

相关文档
最新文档