1. js Code
Copy code The Code is as follows: // ************ the default setting definition. *********************
Tpopwait = 50; // The prompt is displayed after the twait Hao seconds.
Tpopshow = 5000; // display the tshow Hao seconds before closing the prompt
Showpopstep = 20;
Popopacity = 99;
// *************** Internal variable definition *****************
Spop = NULL;
Curshow = NULL;
Tfadeout = NULL;
Tfadein = NULL;
Tfadewaiting = NULL;
document. write ("");
document. write ("
");
Function showpopuptext (){
VaR o = event. srcelement;
Mousex = event. X;
Mousey = event. Y;
If (O. alt! = NULL & O. alt! = "") {O. dypop = O. ALT; O. Alt = ""};
If (O. title! = NULL & O. title! = "") {O. dypop = O. Title; O. Title = ""};
If (O. dypop! = Spop ){
Spop = O. dypop;
Cleartimeout (curshow );
Cleartimeout (tfadeout );
Cleartimeout (tfadein );
Cleartimeout (tfadewaiting );
If (spop = NULL | spop = ""){
Dypoplayer. innerhtml = "";
Dypoplayer. style. Filter = "alpha ()";
Dypoplayer. Filters. Alpha. Opacity = 0;
}
Else {
If (O. dyclass! = NULL) popstyle = O. dyclass
Else popstyle = "cpoptext ";
Curshow = setTimeout ("showit ()", tpopwait );
}
}
}
Function showit (){
Dypoplayer. classname = popstyle;
Dypoplayer. innerhtml = spop;
Popwidth = dypoplayer. clientwidth;
Popheight = dypoplayer. clientheight;
If (mousex + 12 + popwidth> document. Body. clientwidth) popleftadjust =-popWidth-24
Else popleftadjust = 0;
If (Mousey + 12 + popheight> document. Body. clientheight) poptopadjust =-popHeight-24
Else poptopadjust = 0;
Dypoplayer. style. Left = mousex + 12 + document. Body. scrollleft + popleftadjust;
Dypoplayer. style. Top = Mousey + 12 + document. Body. scrolltop + poptopadjust;
Dypoplayer. style. Filter = "alpha (opacity = 0 )";
Fadeout ();
}
Function fadeout (){
If (dypoplayer. Filters. Alpha. Opacity <popopacity ){
Dypoplayer. Filters. Alpha. Opacity + = showpopstep;
Tfadeout = setTimeout ("fadeout ()", 1 );
}
Else {
Dypoplayer. Filters. Alpha. Opacity = popopacity;
Tfadewaiting = setTimeout ("fadein ()", tpopshow );
}
}
Function fadein (){
If (dypoplayer. Filters. Alpha. Opacity> 0 ){
Dypoplayer. Filters. Alpha. Opacity-= 1;
Tfadein = setTimeout ("fadein ()", 1 );
}
}
Document. onmouseover = showpopuptext;
2.html Code contains JS Code. Example
For details, refer to the test code provided by the script home.Xmlns = "http://www.w3.org/1999/xhtml">
Test code in the test center. Theoretically, it should be okay.
Big and small