如何实现文本的卷屏浏览?
时间:2010-05-24 18:36:00
reader.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<title>精彩春风之文本自动卷屏</title>
<base target="main">
head>
<body background="_themes/blends/blegtext.gif">
<form action="read.asp" method="post" name="test" onSubmit="init()" target="display">
文件名:<input type="file" name="filename" size="15">
<input type="submit" value="阅读" name="b1">
<input type="button" name="b2" value="停止" onClick="stop()">
卷屏速度:<input type="text" name="speed" value="1" size="2">
<input type="button" value="改变速度" name="b3" onClick="change()">
</form>
<script Language="JavaScript">
var y = 0
var flag = 0
var speed = 1
function init(){
setTimeout("scrolling()",2000);
flag = 1;
y = 0;
return true;
}
function scrolling(){
if (flag == 1) {
parent.display.scroll(0,y);
y= y + speed
setTimeout("scrolling()",5);
}
}
function stop(){
if ( flag == 1 ) {
flag = 0;
document.test.b2.value = "Start";
}
else {
flag = 1;
document.test.b2.value= "Stop";
setTimeout("scrolling()",500);
}
}
function change(){
speed = parseInt(document.test.speed.value,10);
}
</script>
</body>
</html>
display.asp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb_2312-80">
<title>精彩春风之文本显示</title>
</head>
<body background="_themes/blends/blegtext.gif" bgproperties="fixed">
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim filename, fs, f, s , readf , skip , I
filename = Request.Form("filename")
Set fs = Server.CreateObject("Scripting.FileSystemObject")
If fs.FileExists(filename) then
Set f = fs.GetFile(filename)
Set readf = f.OpenAsTextStream(ForReading,TristateFalse)
Else
Response.Write(filename & "噢,这个文件不存在!")
End if
i = 1
Do While readf.AtEndOfStream <> True
S = readf.ReadLine
Response.Write cstr(i) &" " & S & "<br>"
i = i + 1
Loop
%>
</body>
</html>
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
oracle 触发器 学习笔记
ASP实现上传图片到数据库
AspJpeg 2.0组件使用教程(GIF篇)
![](https://img.aspxhome.com/file/UploadPic/200812/16/aspjpeg-10-48.gif)
HTML 5新增的元素
ASP sql:rs.open语句详细说明
N年前的JAVASCRIPT笔记
网站的视觉路径和版式设计
![](https://img.aspxhome.com/file/UploadPic/20084/15/2008415144523556s.jpg)
怎么样才能让ASP避免被SQL注入啊?
Access2003:不支持这种ActiveX控件
SQL 注入式攻击的终极防范
Request.ServerVariables各参数说明集合
Ajax编程之旅第一站:HTTP请求
![](https://img.aspxhome.com/file/UploadPic/20088/7/2008871327683s.jpg)
jquery中文手册上的一点错误--说说p标签失去焦点
![](https://img.aspxhome.com/file/UploadPic/20099/13/c88879ae2c3bd9614bc01e7e8f79ce54-99s.jpg)
在sql中返回插入的记录的id
MySQL数据库root权限丢失解决方案
优化代码 改善CSS文件可读性
![](https://img.aspxhome.com/file/UploadPic/20086/13/2008613141551898s.gif)