JavaScript special Effects source code (1, text effects)

Source: Internet
Author: User

1, the hidden effect of the progressive

  Hide-and-drop text effects [recommended] [for ie4++] (2 steps according to the instructions after modifying the displayed text) 1. The following code is placed in the HTML <body></body> area of a new page: [There must be nothing on the page]< html>

 2, super cool text effects

Cool text effects [Special Recommendations] [total 2 steps] 1, add the following code between the Heml 

Special effects for  3, shadow text

Cool text effects [Special Recommendations] [total 2 steps] 1, add the following code between the Heml 

 4, color text special effects

Special effects of colored text [recommended] [modified according to the instructions below] 1, the following code is placed in the HTML <body></body> area: [Appropriate location]:<script language= " JavaScript "><!--Begintext =" javascript source code Daquan "; The text displayed color1 = "Blue"; The color of the text Color2 = "Red"; The color of the conversion fontsize = "8"; Font size speed = 100; Conversion speed (1000 = 1 seconds) i = 0;if (navigator.appname = = "Netscape") {document.write ("<layer id=a Visibility=show></lay Er><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> ');d ocument.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.chara T (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>

5. Special effects of lifting and descending text

Lifting text special effects [modify the displayed text] [1 steps according to the instructions below] 1, the following code is placed between the <body></body> of HTML [appropriate location]:<script language=] JavaScript ><!--done = 0;step = 4function Anim (yp,yk) {if (document.layers) document.layers["Napis"].top=yp;else document.all["Napis"].style.top=yp;if (yp>yk) step = -4if (yp<60) step = 4setTimeout (' Anim (' + (yp+step) + ', ' +yk+ ') ', 35);} function Start () {if (done) Returndone = 1;if (navigator.appname== "Netscape") {DOCUMENT.NAPIS.LEFT=INNERWIDTH/2-145; Anim (60,innerheight-60)}else {napis.style.left=11;anim (60,document.body.offsetheight-60)}}//--></script ><div id= "Napis" style= "Position:absolute;top: -50;color: #000000; font-family: song body; font-size:9pt;" ><p> Thank you for your use! </p></div><script language= "JavaScript" ><!--setTimeout (' Start () ', ' ten ');//--></script >

6. Special effects when typing

Typing effect of text effects [modify the displayed text can] [according to the following instructions for a total of 1] 1, the following code is placed between the <body></body> of HTML [appropriate location]:<script language= Javascript>var Layers =document.layers,style=document.all,both=layers| | Style,idme=908601;if (layers) {layerref= ' document.layers '; styleRef = ';} if (style) {layerref= ' document.all '; styleRef = '. Style ';} function Writeontext (OBJ,STR) {if (layers) with (Document[obj]) {document.open ();d ocument.write (str);d Ocument.close ( );} if (style) eval (obj+ '. Innerhtml=str '); }var dispstr=new Array ("JavaScript Source Code Encyclopedia"), var overme=0;function txttyper (str,idx,idobj,spobj,clr1,clr2,delay,plysnd {var tmp0=tmp1= ', Skip=100;if (both && idx<=str.length) {if (Str.charat (idx) = = ' < ') {while (Str.charat ( IDX)! = ' > ') idx++;idx++;} if (Str.charat (idx) = = ' & ' &&str.charat (idx+1)! = ') {while (Str.charat (idx)! = '; ') idx++;idx++;} Tmp0 = Str.slice (0,idx), TMP1 = Str.charat (idx++), if (overme==0 && plysnd==1) {if (Navigator.plugins[0]) {if ( navigator.plugins["LiveAudio"][0].type== "Audio/basic" && NavigAtor.javaenabled ()) {document.embeds[0].stop (); SetTimeout ("Document.embeds[0].play (False)", 100);}} else if (document.all) {ding. Stop (); SetTimeout ("Ding. Run () ", 100);} overme=1;} else Overme=0;writeontext (idobj, "<span class=" +spobj+ "><font color= '" +clr1+ "' >" +tmp0+ "</font> <font color= ' "+clr2+" > "+tmp1+" </font></span> ") setTimeout (" Txttyper "+str+" ', "+idx+", ' "+ idobj+ "', '" +spobj+ "', '" +clr1+ "', '" +clr2+ "'," +delay+ "," +plysnd+ ")", delay);} function init () {txttyper (dispstr[0], 0, ' ttl0 ', ' ttl1 ', ' #339933 ', ' #99FF33 ', 300, 0);}   </script><body onload=init () ><div CLASS=TTL1 id=ttl0></div></body>

 7, fade text effects

Fade in text effects [3 steps according to the instructions below] 1. The following code is placed between 

 8, hot text effects

  Special effects of fiery text [for ie4++] (total 3 steps according to the instructions below) 1, add the following code to HEML 

 9, status bar text effects

  Text in the status bar [modify the displayed text to copy to <body></body>]<script Language=javascript>var message= "JavaScript Source Encyclopedia" var Position=100var Delay=5var scroll=new statusmessageobject () function Statusmessageobject (p,d) {this.msg = Messagethis.out = "" This.pos =positionthis.delay=delaythis.i=0this.reset=clearmessage}function ClearMessage () { This.pos=position}function scroller () {for (scroll.i=0;scroll.i<scroll.pos;scroll.i++) {scroll.out + = ""}if ( Scroll.pos >= 0) scroll.out + = Scroll.msgelse scroll.out=scroll.msg.substring (-scroll.pos,scroll.msg.length) Window.status=scroll.outscroll.out= "" Scroll.pos--if (Scroll.pos <-(scroll.msg.length)) {Scroll.reset ()} SetTimeout (' scroller () ', Scroll.delay)}function Snapin (jumpspaces,position) {var msg = Scroll.msgvar out = "" For (Var i=0 ; i<position; i++) {out+= Msg.charat (i)}for (i=1;i<jumpspaces;i++) {out + = ""}out+=msg.charat (position) Window.status = Outif ( Jumpspaces <= 1) {position++if (Msg.charat (position) = = ") {position++}jumpspaces = 100-posItion}else if (Jumpspaces > 3) {jumpspaces *=. 75}else{jumpspaces--}if (Position! = msg.length) {var cmd = "Snapin (" + Ju Mpspaces + "," + position + ")"; scrollid = Window.settimeout (Cmd,scroll.delay);} Else{window.status= "" Jumpspaces=0position=0cmd = "Snapin (" + Jumpspaces + "," + position + ")"; scrollid = Window.settimeou  T (Cmd,scroll.delay); return false}return True}snapin (100,0);</script>

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.