Hiệu ứng chữ chạy đẹp cho web/blog
<script type='text/javascript'>
//<![CDATA[
var message = " THỦ THUẬT 30S XIN CHÀO CÁC BẠN ";
var neonbasecolor = "#1E90FF";
var neontextcolor = "#00008B";
var neontextcolor2 = "#FF00FF";
var flashspeed = 150; // velocidad en milisegundos
var flashingletters = 1; // cantidad letras del efecto neontextcolor
var flashingletters2 = 1; // cantidad letras del efecto neontextcolor2
var flashpause = 1; // pausa entre ciclos
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>
Java Script tạo hiệu ứng chữ đẹp
4/
5
Oleh
nguyengia