Js realizes the scrolling and color-changing text effect. On the effect display page, you can see the text alternating color-changing display to attract people's attention. The effect is really good. After copying the code to your website, it will be OK to modify it into the desired text.
The following is the source code:
The code copy is as follows:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Scrolling color-changing text js special effects</title>
</head>
<body>
<div>
Please pay attention to the text below, some of the text is dyed red, and the red moves in a loop. <a href="http://keleyi.com/a/bjad/bd55blos.htm" target="_blank">Original text</a>
</div>
<script type="text/javascript">
var message="Welcome to Keleyi.com, here are learning materials such as web front-end."
var neonbasecolor="#333333"
var neontextcolor="#ff0000"
var neontextcolor2 = "#ff3333"
var flashspeed=100
var flashingletters=8
var flashingletters2=2
var flashpause=0
var n=0
if (document.all||document.getElementById){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
document.write('</font>')
}
else
document.write(message)
function crossref(number){
var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
return crossobj
}
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
crossref(m).style.color=neonbasecolor
}
crossref(n).style.color=neontextcolor
if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor
if (n<message.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",flashpause)
Return
}
}
function beginneon(){
if (document.all||document.getElementById)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>
<div><br /><a href="http://keleyi.com" target="_blank">keleyi.com</a></div>
</body>
</html>