JavaScript special Effects source code (8, other effects)

Source: Internet
Author: User
Tags password protection

1. Chinese date

Chinese date [without modification] [a total of 1 steps]]====1, add the following code heml between the <body></body> <script language= "JavaScript" >function number (INDEX1) {var numberstring= "1,234,567,890"; if (index1 ==0) {document.write ("ten")}if (Index1 <) {document.write ( Numberstring.substring (0+ (index1-1), index1))}else if (Index1 <) {document.write ("ten" +numberstring.substring (0+ (index1-11), (index1-10)))}else if (Index1 <) {document.write ("20" +numberstring.substring (0+ (index1-21), ( index1-20))}else{document.write ("30" +numberstring.substring (0+ (index1-31), (index1-30)))}}var today1 = new Date () var month = Today1.getmonth () +1var date = Today1.getdate () var day = Today1.getday () document.write ("<br><strong ><small><center> ") document.write (" A.D. 2000 ") Number (month) document.write (" Monthly ") Number (date) document.write ("Day </small><center>") </script>  

2. Current date and time

3. Rolling subtitles with connection

  Rolling subtitles with links [modify name and link] [a total of 1 steps]====1, add the following code heml between the <body></body> <script language= "JavaScript1.2" >// Set the width of the marquee (in pixels) var marqueewidth=400//set the height of the marquee (in pixels, the parameter applies only to NS) Var marqueeheight=20//set the speed of marquee scrolling var speed=4//sets marquee display content, using standard HTML syntax. var marqueecontents= ' <strong><big> Welcome to <a href= "http://www.happydrips.com" > Joy drops </a> Welcome to visit <a href= "mailto:[email protected" > Send me a letter! </a></big></strong></font> ' if (document.all) document.write (' <marquee scrollamount= ' + Speed+ ' style= ' width: ' +marqueewidth+ ' > ' +marqueecontents+ ' </marquee> ') function regenerate () { Window.location.reload ()}function Regenerate2 () {if (document.layers) {setTimeout ("window.onresize=regenerate", 450 ) Intializemarquee ()}}function intializemarquee () {Document.cmarquee01.document.cmarquee02.document.write (' < Nobr> ' +marqueecontents+ ' </nobr> ') document.cmarquee01.document.cmarquee02.document.close () thelength= Document.cmarquee01. Document.cmarquee02.document.widthscrollit ()}function scrollit () {if ( document.cmarquee01.document.cmarquee02.left>=thelength* ( -1)) {document.cmarquee01.document.cmarquee02.left- =speedsettimeout ("Scrollit ()", (+)}else{document.cmarquee01.document.cmarquee02.left=marqueewidthscrollit ()}} Window.onload=regenerate2</script><ilayer width=&{marqueewidth}; height=&{marqueeheight};   Name= "CMARQUEE01" > <layer name= "cmarquee02" ></layer></ilayer>

 4, vertical scrolling bulletin board

  Vertical scrolling bulletin board [modify displayed text] [a total of 2 steps]====1, add the following code to the heml between the 

5. Close the window

6. MIDI Player

Very good MIDI player [total 2 steps] (can be modified according to the corresponding project) ====1, add the following code between the 

7. Greeting words

8. Password protection page

password protection page [Change Password] [total 1 steps] 1, add the following code between the Heml <body></body>: <script language= "JAVASCRIPT" ><!--Loopy () function loopy () {var SWord = "" while (sWord! = "Login") {//change to your own password! SWord = Prompt ("Enter the correct password to login! Password: Login")}alert ("AH ... Welcome to visit! ")}//--></script>   

9. Current time

The current time [without modification] [total 1 steps]====1, add the following code to the HEML <body></body>: <script language=javascript>var timerid = null var timerrunning = false;function Stopclock () {if (timerrunning) cleartimeout (timerid); timerrunning = false;} function Startclock () {Stopclock (); Showtime ();} function Showtime () {var now = new Date (), var hours = now.gethours (); var minutes = Now.getminutes (); var seconds = Now.get Seconds () var timevalue = "" + ((Hours >= 12)? " PM ":" Morning ") TimeValue + = ((Hours >12)? hours-12:hours) TimeValue + = ((minutes < 10)? ": 0": ":") + Minutestimevalue + = ((seconds < ten)? ": 0": ":") + Secondsdocument.clock.thetime.value = Timevalue;timer ID = SetTimeout ("Showtime ()", "n"); timerrunning = true;} </script><body onload=startclock () ><form name=clock ><input name=thetime style= "FONT-SIZE:9PT; Color: #000000; border:0 "size=12></form></body>  

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.