• 跑马灯


    //开始不跑,原因是函数必须放在调用函数之前!!!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>练习</title> <script type="text/javascript"> onload = function () { var txt = document.getElementById("txt"); var txt2 = txt.innerHTML.trim(); // alert(txt.innerHTML.trim().charAt(0)); //alert(txt.innerHTML.trim().substr(0,2));        //函数放在前面!! var paoMaDeng = function () {
            //两个获取字符的方法,charAt(0)和substr(0,1)
    var first = txt2.charAt(0); var rest = txt2.substr(1); txt2 = rest + first; txt.innerHTML = txt2; }
            //调用放在后面!!! aaa
    = setInterval(paoMaDeng, 100); } </script> </head> <body> <p id="txt"> 北京欢迎你!</p> <input type = "button" value = "停止" id = "btn" onclick="clearInterval(aaa);"/> </body> </html>
  • 相关阅读:
    文件操作fopen
    随机数应用
    随机数
    通过命令行参数打开文件
    命令行参数
    内存分区
    const修饰指针+volatile +restrict
    类型限定词——const
    (app笔记)Appium如何开启、配置、启用
    (app笔记)Memory Fill内存填充
  • 原文地址:https://www.cnblogs.com/Jacklovely/p/5339474.html
Copyright © 2020-2023  润新知