For example, jsp:
<SCRIPT type = text/javascript src = "js/jquery. tooltip. v.1.1.js"> </SCRIPT>
<SCRIPT type = text/javascript src = "js/jquery.tooltip.exe cute. js"> </SCRIPT>
Model: <a href = "# nogo" class = "with-tooltip" title = "$ {air. aircrafttype} </a>
Jquery.tooltip.exe cute. js:
$ (Document). ready (function (){
$ (". With-tooltip"). simpletooltip ();
});
Tooltip. v.1.1.js: www.2cto.com
/**
*
* SimpleTooltip jQuery plugin, by Marius ILIE
* Visit http://dev.mariusilie.net for details
*
**/
(Function ($) {$. fn. simpletooltip = function (){
Return this. each (function (){
Var text = $ (this). attr ("title ");
$ (This). attr ("title ","");
If (text! = Undefined ){
$ (This). hover (function (e ){
Var tipX = e. pageX + 12;
Var tipY = e. pageY + 12;
$ (This). attr ("title ","");
$ ("Body "). append ("<div id = 'simpletooltip 'style = 'position: absolute; z-index: 100; display: none; '> "+ text +" </div> ");
If ($. browser. msie) var tipWidth = $ ("# simpleTooltip"). outerWidth (true)
Else var tipWidth = $ ("# simpleTooltip"). width ()
$ ("# SimpleTooltip"). width (tipWidth );
$ ("# SimpleTooltip" ).css ("left", tipX).css ("top", tipY). fadeIn ("medium ");
}, Function (){
$ ("# SimpleTooltip"). remove ();
$ (This). attr ("title", text );
});
$ (This). mousemove (function (e ){
Var tipX = e. pageX + 12;
Var tipY = e. pageY + 12;
Var tipWidth = $ ("# simpleTooltip"). outerWidth (true );
Var tipHeight = $ ("# simpleTooltip"). outerHeight (true );
If (tipX + tipWidth> $ (window). scrollLeft () + $ (window). width () tipX = e. pageX-tipWidth;
If ($ (window). height () + $ (window). scrollTop () <tipY + tipHeight) tipY = e. pageY-tipHeight;
$ ("# SimpleTooltip" ).css ("left", tipX).css ("top", tipY). fadeIn ("medium ");
});
}
});
}) (JQuery );
Author: gdn_wolf