1. Show different greeting
in different time periods
〈script language= "Javascript" 〉〈!--var text= ""; Day = new Date (); Time = Day.gethours (); if ((time〉=0) && (time〈7)) text= "Night Owl, pay attention to the body Oh!" "If ((time〉= 7) && (time〈12)) text=" The sun is so bright today, what about your friend? if ((time〉=) && (time〈14)) text= "Lunch hour." You want to keep sleep! " if ((time〉=14) && (time〈18)) text= "Wish you a pleasant afternoon work!" "If ((time〉=) &&) text=" You are here again, do not talk to mm too long Oh! " if ((time〉=) && (time〈24)) text= "You should rest!" document.write (text)//---〉〈/script〉
2. Slowly become larger window
〈script language= "Javascript" 〉〈!-- var windowsheight=100 var windowswidth=100 var numx=5 Function openwindow (thelocation) { temploc=thelocation if ( Window.resizeto&&document.all) &&! (Window.resizeto&&document.getelementbyid)) { window.open (thelocation) return } Windowsize=window.open ("", "", "scrollbars") &nbs P Windowsize.moveto (0,0) Windowsize.resizeto (100,100) TENUMXT () } function tenumxt () {& nbsp if (windowsheight〉=screen.availheight-3) numx=0 Windowsize.resizeby (5,numx) Windowsheight+ =5 windowswidth+=5 if (windowswidth〉=screen.width-5) { windowsize.location=temploc& nbsp windowsheight=100 windowswidth=100 numx=5 return } setTimeout ("Tenumxt ()", m) &nbs P } //--〉〈/script〉〈p〉〈a href= "JavascripT:openwindow (' http://www.ccjol.com ') "into 〈/a〉
3. Change IE's address bar ie icon
we have to do a 16*16 icon (image file), Save as Index.ico. Upload this icon file to the root directory and add the following code to the home 〈head〉〈/head〉: 〈link REL = "shortcut icon" href= "Index.ico" 〉
4. Let the Web page feel free to retreat
〈a href= "Javascript:history.go (x)" 〉x〈/a〉//replace X with the number you want to back up in page//Turn "-" into "+" for forward
5. Pop-up message box when mouse pointer
adds the following code between 〈body〉〈/body〉: 〈a href onmouseover= "alert (' Pop-up info! ')" Shows the link text 〈/a〉
6. Click the right mouse button to eject the Add Favorites dialog box
adds the following code between 〈body〉〈/body〉: 〈script language=javascript〉if (document.all) document.body.onmousedown=new Function ("I F (event.button==2| | event.button==3) window.external.addFavorite (' Your URL ', ' Your website name ') 〈/script〉
7. Random Transform background image (a special effect that can refresh the mood)
Add the following code between the 〈head〉〈/head〉: 〈script language= "Javascript" 〉image = new Array (4); Define image as the number of pictures of the array image [0] = ' tu0.gif '//Background image path Image [1] = ' tu1.gif ' image [2] = ' tu2.gif ' image [3] = ' tu3.gif ' Image [4] = ' tu4.gif ' number = Math.floor (Math.random () * image.length); document.write ("〈body background=" +image[number]+ ")"; 〈/script〉
8. Translucent display effect of the table
〈head〉〈style〉.alpha{filter:alpha (OPACITY=50)}//50 represents 50% transparency 〈/style〉〈/head〉〈body〉〈table border= "1" width = "height=" class= "Alpha" bgcolor= "#F2A664" 〉〈tr〉〈td width= "100%" height= "62" 〉〈div align= "center" is cool, right!〈/div〉 〈/td〉〈/tr〉〈/table〉〈/body〉