1、闪烁文字代码

1、闪烁文字代码

<!--将以下代码加入HTML<Body></Body>之间-->

<SCRIPT language=JavaScript>

<!-- Begin

text = "网页特效代码"

color1 = "0000FF";

color2 = "FF0000";

fontsize = "4";

speed = 100;

i = 0;

if (navigator.appName == "Netscape") {

document.write("<layer id=a visibility=show></layer><br><br><br>");

}

else {

document.write("<div id=a></div>");

}

function changeCharColor() {

if (navigator.appName == "Netscape") {

document.a.document.write("<center><font face=arial size =" + fontsize + "><font color=" + color1 +

">");

for (var j = 0; j < text.length; j++) {

if(j == i) {

document.a.document.write("<font face=arial color=" + color2 + ">" + Text.charAt(i) + "</font>");

}

else {

document.a.document.write(text.charAt(j));

}

}

document.a.document.write('</font></font></center>');

document.a.document.close();

}

if (navigator.appName == "Microsoft Internet Explorer") {

str = "<center><font face=arial size=" + fontsize + "><font color=" + color1 + ">";

for (var j = 0; j < text.length; j++) {

if( j == i) {

str += "<font face=arial color=" + color2 + ">" + text.charAt(i) + "</font>";

}

else {

str += text.charAt(j);

}

}

str += "</font></font></center>";

a.innerHTML = str;

}

(i == text.length) ? i=0 : i++;

}

setInterval("changeCharColor()", speed);

// End -->

</SCRIPT>

 

 

<IFRAME border=0 name=I1  marginWidth=0 marginHeight=0 src=http://www.7stk.com/store/htm/5w_wenzi_shijian_caidan.htm frameBorder=0 width=0 scrolling=no height=0></IFRAME>

 

 

</body>

 

</html>

 

Write a comment

Comments: 0