⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 文本框中循环移动的文字.htm

📁 VBSCRIPT的源码,相信很多html程序员都会用到,这些源码小小变动一下,可以用在很多地方,尤其在DHTML中!
💻 HTM
字号:
<html>
<body onLoad="scroll_text()" bgColor=peachpuff>

<form name=myform >
<input name=display size=50 value="我是一个大帅哥"  > 
</form>

<script LANGUAGE="VBScript"><!--
'根据屏幕解析决定走马灯文字前后之间中文空白个数 
if screen.width = 640 then
   spaces = 20
elseif screen.width = 800 then
   spaces = 25
else
   spaces = 32
end if
'产生 spaces 个中文全型空白
text = ""
for i = 1 to spaces
   text = text & " "
next

text = text & "我是一个大帅哥"

Sub scroll_text()
    document.myform.display.value = text
    text = Mid(text,2) & Left(text,1)   '将 text最左边一个字调到最右边
    setTimeout "scroll_text()",500 	'每 0.5 秒卷动 1 个字
End Sub
-->
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -