|
I have accumulated many wonderful and practical web special effects over time. These special effects are almost all commonly used webpage special effects. Now I will introduce these sorted and modified special effects in three levels.
Advanced
1. display different greetings 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 your health! "
If (Time> = 7) & (time <12 ))
TEXT = "Today's sunshine is brilliant. What about your friend? "
If (Time> = 12) & (time <14 ))
TEXT = "lunch break time. You need to stay asleep! "
If (Time> = 14) & (time <18 ))
TEXT = "Have a good afternoon! "
If (Time> = 18) & (time <= 22 ))
TEXT = "You're coming again. Don't talk to mm too long! "
If (Time> = 22) & (time <24 ))
TEXT = "you should have taken a rest! "
Document. Write (text)
// --->
</SCRIPT>
2. reflection effect in Water
<Script language = "JavaScript">
Function F1 ()
{
Setinterval ("mdiv.filters.wav E. Phase +=10", 100 );
}
If (document. All)
{
Document. Write ('Style = "filter: Wave (strength = 3, freq = 3, phase = 0, lightstrength = 30) blur () flipv ()"> ')
Window. onload = F1
}
</SCRIPT>
3. a window that gradually grows
<Script language = "JavaScript">
<! --
VaR windowsheight = 100
VaR windowsswidth = 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 ")
Windowsize. moveTo (0, 0)
Windowsize. resizeTo (100,100)
Tenumxt ()
}
Function tenumxt (){
If (windowsheight> = screen. availHeight-3)
Numx = 0
Windowsize. resizeBy (5, numx)
Windowsheight + = 5
Windowswidth + = 5
If (windowswidth> = screen. Width-5)
{
Windowsize. Location = temploc
Windowsheight = 100
Windowswidth = 100
Numx = 5
Return
}
SetTimeout ("tenumxt ()", 50)
}
// -->
</SCRIPT>
<P> <a href = "javascript: OpenWindow ('HTTP: // www.ccjol.com ')"> enter </a>
4. Change the IE icon in the IE Address Bar
We need to first create a 16*16 icon (icon file) and save it as index. ICO. Upload the icon file to the root directory and add the following between the Code:
<LINK rel = "shortcut icon" href = "index. ICO">
5. Move the webpage back at will
<A href = "javascript: history. Go (-x)"> x </A> // replace X with the number of pages you want to return
// Change "-" to "+" to forward
6. A dialog box pops up when the cursor points
Add the following code between <body> </body>:
<A href onmouseover = "alert ('pop-up message! ') "> Displayed link text </a>
7. Right-click to bring up the Add favorites dialog box.
Add the following code between <body> </body>:
<Script language = JavaScript>
If (document. All)
Document. Body. onmousedown = new function ("If (event. Button = 2 | event. Button = 3)
Window. External. AddFavorite ('your website', 'Your website )")
</SCRIPT>
8. Random conversion of background images (a special effect that refreshes the mood)
Add the following code between
<Script language = "JavaScript">
Image = new array (4); // defines the image as an array of the number of images.
Image [0] = 'tu0.gif '// path of the background image
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>
9. Click the link to show the color
Add the following code between <body> </body>:
<P onmousemove = "anniu ()"> If you dare to touch me, I will show you some color! </P>
<Script language = "VBScript">
Sub anniu
Document. fgcolor = int (256*256*256 * RND)
End sub
</SCRIPT>
10. Windows with Phantom effects falling from the sky
<Head>
<Script language = "JavaScript">
Function move (x ){
If (self. moveBy ){
Self. moveBy (0,-800 );
For (I = x; I> 0; I --)
{
Self. moveBy (0, 3 );
}
For (j = 200; j> 0; j --) {// if you think the window jitter is severe, replace 200 with a single digit.
Self. moveBy (0, J );
Self. moveBy (J, 0 );
Self. moveBy (0,-j );
Self. moveBy (-J, 0 );
}
}
}
</Scrip>
<Body bgcolor = # ffffff onload = move (280)>
</Body>
</Head>
11. translucent display of the table
Add the following code between
<Style>
. Alpha {filter: alpha (opacity = 50)} // 50 indicates 50% transparency
</Style>
Add the following code between <body> </body>:
<Table border = "1" width = "100" Height = "62" class = "Alpha" bgcolor = "# f2a664">
<Tr>
<TD width = "100%" Height = "62">
<Div align = "center"> cool! </Div>
</TD>
</Tr>
</Table>
Author: liuye Hair Dryer
|