If you see the effect of A tag title on other websites, you can use it on your website. Just learning jquery plug-in extension, I started to write an IE effect by referring to the previous code.
Firefox or other browsers
Code
The Code is as follows:
// Copyright cool che China www.kuchechina.com
// Author: zhuyue.cnblogs.com
// Demonstration http://www.kuchechina.com/carstools/Default.aspx
JQuery. fn. toolTip = function (){
This. unbind (). hover (
Function (e ){
This. t = this. title;
This. title = '';
$ ('Body'). append ('
'+ This. t +'
');
Var tip = require ('p;p_tooltip'}.css ({"position": "absolute", "padding": "10px 5px 5px 10px", "left": "5px", "font-size ": "14px", "background-color": "white", "border": "1px solid # a6c9e2", "line-height": "160% ", "-moz-border-radius": "5px", "-webkit-border-radius": "5px", "z-index": "9999 "});
Var target = $ (this );
Var position = target. position ();
This. top = (position. top-8); this. left = (position. left + target. width () + 5 );
$ ('P # p_toolTip extends img_tooltip_arrow'}.css ({"position": "absolute", "top": "8px", "left": "-6px "});
Tip.css ({"top": this. top + "px", "left": this. left + "px "});
Tip. fadeIn ("slow ");
},
Function (){
This. title = this. t;
$ ("P # p_toolTip"). fadeOut ("slow"). remove ();
}
);
};
Usage:
The Code is as follows: