Implementation of link prompt text

Source: Internet
Author: User
The text effects of link prompts are often encountered on the Web. When the mouse passes through the URL link, a prompt layer (DIV) is immediately displayed, prompting the link content and other related text. although it is implemented by hiding the DIV, I still don't know how to do it. I found a JS file yesterday, which can be easily handled. post it and add it to favorites.
The JS file code is as follows (mouse_on_title.js ):
<! --
// ************ Default setting definition .*********************
TPopWait = 50; // the prompt is displayed after the tWait Hao seconds.
TPopShow = 6000; // display the tShow Hao seconds before closing the prompt
ShowPopStep = 20;
PopOpacity = 95;
Fontcolor = "#000000 ";
Bgcolor = "# EDEDED ";
Bordercolor = "#007db5 ";
// *************** Internal variable definition *****************
SPop = null; curShow = null; tFadeOut = null; tFadeIn = null; tFadeWaiting = null;
Document. write ("<style type = 'text/css 'id = 'defaultpopstyle'> ");
Document. write (". cPopText {background-color: "+ bgcolor +"; color: "+ fontcolor +"; border: 1px "+ bordercolor +" solid; font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha (Opacity = 0 )}");
Document. write ("</style> ");
Document. write ("<div id = 'dypoplay' style = 'position: absolute; z-index: 1000; 'class = 'cpoptext'> </div> ");
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
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.