<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>跑马灯</title>
</head>
<script language="javascript">
var msg="品味中原文化";
var sep=0;
var interval=400;/*移动速度*/
function LenScroll(){
document.nextForm.lenText.value=msg.substring(sep,msg.length)+" "+msg;
sep++;
if(sep>msg.length)
sep=0;
window.setTimeout("LenScroll();",interval);
}
</script>
<style>
body{
background-color:#FFFFFF;
}
input{
background:transparent;/*输入框背景透明*/
color:#ffb400;
font-size:20px;
font-weight:bold;
}
</style>
<body onLoad="LenScroll()">
<center>
<form name="nextForm">
<input type="text" name="lenText">
</form>
</center>
</body>
</html>
【HTML+javaScript】滚动-跑马灯
最新推荐文章于 2024-09-02 00:33:33 发布