Never disappear title hint code _ typical special effects

Source: Internet
Author: User
Tags visibility

Copy Code code as follows:

<a onmouseover= "DRS (" all areas of the network (Beijing, Hunan, Anhui, Guangxi, Henan, Hebei, Jilin, Tianjin, Chongqing, Shanxi, Yunnan, Inner Mongolia, Jiangxi, Xinjiang, Gansu, Hainan, Guizhou, Ningxia, Qinghai, Tibet) is 977715<br> Guangdong, Shanghai, Liaoning, Sichuan, Fujian, Zhejiang, Heilongjiang, Shandong, Hubei, Shaanxi, 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";}

The color of the border and the color of the title bar;
The usual color is deep (brown, black, etc.). )
if (typeof BackColor = = ' undefined ') {var BackColor = "#FF9900";}


The color of the text
usually a darker color;
if (typeof TextColor = = ' undefined ') {var textcolor = "#000000";}

Color of the title
usually a crisp color;
if (typeof Capcolor = = ' undefined ') {var capcolor = "#FFFFFF";}

Color of "close"
usually a crisp color;
if (typeof Closecolor = = ' undefined ') {var closecolor = "#9999FF";}


The width of the pop-up window;
100-300 pixels suitable
if (typeof width = = ' undefined ') {var width = "280";}

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


Pop-up window is located on the left or right side of the mouse, pixel.
3-12 fit
if (typeof offsetx = = ' undefined ') {var offsetx = 10;}

The distance at which the pop-up window is below the mouse;
3-12 fit
if (typeof offsety = = ' undefined ') {var offsety = 10;}

////////////////////////////////////////////////////////////////////////////////////
Set End
////////////////////////////////////////////////////////////////////////////////////

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 is the public function used in 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 function, which is 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=\ "Song color=\" "+textcolor+" > "+text+" </font></td></tr></ Table></td></tr></table> "
Layerwrite (TXT);
dir = D;
Disp ();
}



Common calls
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.document
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.