如何实现文本的卷屏浏览?

时间: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>

标签:浏览,asp
0
投稿

猜你喜欢

  • 本机安装PaddlePaddle安装指南及步骤详解

    2023-12-18 19:35:57
  • Python实现的对本地host127.0.0.1主机进行扫描端口功能示例

    2021-05-13 08:43:23
  • mysql 常用命令集锦(Linux/Windows)

    2024-01-17 07:26:20
  • 利用Python自动生成PPT的示例详解

    2021-10-16 18:25:08
  • asp更改Windows2000管理者密码?

    2010-06-26 11:03:00
  • Python super()函数使用及多重继承

    2022-10-06 19:21:37
  • MYSQL 批量替换之replace语法的使用详解

    2024-01-21 19:52:35
  • perl大文件读取处理的模块介绍

    2023-12-27 20:10:27
  • 通过两种方式增加从库——不停止mysql服务

    2024-01-17 17:44:28
  • 详解RIFF和WAVE音频文件格式

    2023-03-30 15:58:13
  • Go语言基础结构体用法及示例详解

    2024-04-25 15:11:34
  • Python编程之string相关操作实例详解

    2023-01-05 04:17:47
  • python常见数制转换实例分析

    2021-04-04 08:09:32
  • Mysql事务特性和级别原理解析

    2024-01-25 11:00:04
  • python动态文本进度条的实例代码

    2021-11-15 02:11:50
  • Python中IP地址处理IPy模块的方法

    2023-05-19 05:21:25
  • MySQL事务的隔离级别详情

    2024-01-27 23:33:56
  • vue使用canvas绘制圆环

    2024-05-02 17:04:29
  • python基于event实现线程间通信控制

    2022-04-30 07:10:51
  • 美之鉴 – 女人与Web设计

    2009-12-09 15:36:00
  • asp之家 网络编程 m.aspxhome.com