Home > Web Front-end > JS Tutorial > js text box moving marquee effect code sharing_javascript skills

js text box moving marquee effect code sharing_javascript skills

WBOY
Release: 2016-05-16 15:42:52
Original
2027 people have browsed it

The example in this article describes the js implementation of the text box moving marquee effect. Share it with everyone for your reference. The details are as follows:

Operation rendering:

Tips: Just copy the code shared below to run it. You can customize the text.
The js code shared with everyone to realize the text box moving marquee effect is as follows

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文本框走动跑马灯代码</title>
</head>
<SCRIPT Language="JavaScript">

var msg="欢迎访问脚本之家 www.jb51.net";
var interval = 100;
var space10="";
var seq=0;

function Scroll() {
document.tmForm.tmText.value = msg.substring(seq, msg.length) + space10 + msg.substring(0, msg.length);
seq++;seq++;
if ( seq > msg.length ) { seq = 0 };
window.setTimeout("Scroll();", interval );
} 

</SCRIPT>

<BODY OnLoad="Scroll();" >

<CENTER><FORM Name=tmForm>
<INPUT Type=Text Name=tmText Size=45>
</FORM></CENTER>


<body>
</body>
</html>
Copy after login

The above is the js code shared with you to implement the text box moving marquee effect. I hope you can like it.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template