Title prompt code that never disappears

Source: Internet
Author: User

Copy codeThe Code is as follows: <a onMouseOver = "drs ('all regions of the network (Beijing, Hunan, Anhui, Guangxi, Henan, Hebei, Jilin, Tianjin, Chongqing, Shanxi, Yunnan, Inner Mongolia, Jiangxi, and Xinjiang), Gansu, Hainan, Guizhou, Ningxia, Qinghai, and Tibet) yes 977715 <br> Guangdong, Shanghai, Liaoning, Sichuan, Fujian, Zhejiang, Heilongjiang, Shandong, Hubei, Shaanxi, and Jiangsu 377715 '); return true; "onMouseOut =" nd (); return true; "href = #> note </a>

JS Code:

//////////////////////////////////////// //////////////////////////////////////// ////
// CONFIGURATION
//////////////////////////////////////// //////////////////////////////////////// ////

// Main background color (Large Area)
// Usually use bright colors (light yellow, etc ...)
If (typeof fcolor = 'undefined') {var fcolor = "ffffff ";}

// Border color and title bar color;
// The General color is dark (brown, black, etc .)
If (typeof backcolor = 'undefined') {var backcolor = "# FF9900 ";}

// Text color
// It is usually a relatively deep color;
If (typeof textcolor = 'undefined') {var textcolor = "#000000 ";}

// Title color
// Usually bright colors;
If (typeof capcolor = 'undefined') {var capcolor = "# FFFFFF ";}

// "Close" color
// Usually bright colors;
If (typeof closecolor = 'undefined') {var closecolor = "# 9999FF ";}

// Display the window width;
// 100-300 pixels suitable
If (typeof width = 'undefined') {var width = "280 ";}

// The width and pixel of the edge.
// 1-3 pixels is suitable
If (typeof border = 'undefined') {var border = "2 ";}

// The distance (in pixels) between the left and right of the mouse in the pop-up window.
// 3-12 suitable
If (typeof offsetx = 'undefined') {var offsetx = 10 ;}

// The distance below the mouse in the pop-up window;
// 3-12 suitable
If (typeof offsety = 'undefined') {var offsety = 10 ;}

//////////////////////////////////////// //////////////////////////////////////// ////
// The setting ends.
//////////////////////////////////////// //////////////////////////////////////// ////

Ns4 = (document. layers )? True: false
Ie4 = (document. all )? True: false

// Microsoft Stupidity Check.
If (ie4 ){
If (navigator. userAgent. indexOf ('msie 5')> 0 ){
Ie5 = true;
} Else {
Ie5 = false ;}
} Else {
Ie5 = false;
}

Var x = 0;
Var y = 0;
Var snow = 0;
Var sw = 0;
Var cnt = 0;
Var dir = 1;
Var tr = 1;
If (ns4) | (ie4 )){
If (ns4) over = document. overDiv
If (ie4) over = overDiv. style
Document. onmousemove = mouseMove
If (ns4) document. captureEvents (Event. MOUSEMOVE)
}

// The following are public functions used on the page;

// Simple popup right
Function drs (text ){
Dts (1, text );
}

// Clears popups if appropriate
Function nd (){
If (cnt> = 1) {sw = 0 };
If (ns4) | (ie4 )){
If (sw = 0 ){
Snow = 0;
HideObject (over );
} Else {
Cnt ++;
}
}
}

// Non-public functions, called by other functions;

// Simple popup
Function dts (d, text ){
Txt = "<table width =" + width + "BORDER = 0 CELLPADDING =" + border + "CELLSPACING = 0 BGCOLOR = \" "+ backcolor +" \ "> <TR> <TD> <table width = 100% BORDER = 0 CELLPADDING = 2 CELLSPACING = 3 BGCOLOR = \ "" + fcolor + "\"> <TR> <td class = P1> <FONT FACE = \ "\" COLOR = \ "" + textcolor + "\"> "+ text +" </FONT> </TD> </TR> </TABLE> </TD> </TR> </TABLE>"
LayerWrite (txt );
Dir = d;
Disp ();
}

// Common CILS
Function disp (){
If (ns4) | (ie4 )){
If (snow = 0 ){
If (dir = 2) {// Center
MoveTo (over, x + offsetx-(width/2), y + offsety );
}
If (dir = 1) {// Right
MoveTo (over, x + offsetx, y + offsety );
}
If (dir = 0) {// Left
MoveTo (over, x-offsetx-width, y + offsety );
}
ShowObject (over );
Snow = 1;
}
}
// Here you can make the text goto the statusbar.
}

// Moves the layer
Function mouseMove (e ){
If (ns4) {x = e. pageX; y = e. pageY ;}
If (ie4) {x = event. x + document. body. scrollLeft; y = event. y + document. body. scrollTop ;}
If (ie5) {x = event. x + document. body. scrollLeft; y = event. y + document. body. scrollTop ;}
If (snow ){
If (dir = 2) {// Center
MoveTo (over, x + offsetx-(width/2), y + offsety );
}
If (dir = 1) {// Right
MoveTo (over, x + offsetx, y + offsety );
}
If (dir = 0) {// Left
MoveTo (over, x-offsetx-width, y + offsety );
}
}
}

// The Close onMouseOver function for Sticky
Function cClick (){
HideObject (over );
Sw = 0;
}

// Writes to a layer
Function layerWrite (txt ){
If (ns4 ){
Var lyr = document.overDiv.doc ument
Lyr. write (txt)
Lyr. close ()
}
Else if (ie4) document. all ["overDiv"]. innerHTML = txt
If (tr ){}
}

// Make an object visible
Function showObject (obj ){
If (ns4) obj. visibility = "show"
Else if (ie4) obj. visibility = "visible"
}

// Hides an object
Function hideObject (obj ){
If (ns4) obj. visibility = "hide"
Else if (ie4) obj. visibility = "hidden"
}

// Move a layer
Function moveTo (obj, xL, yL ){
Obj. left = xL
Obj. top = yL
}

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.