代码如下:
var x = 10;
var y = 10;
$("a.tooltip").mouseover(function (e) {
this.myTitle = this.title;
this.title = "";
this.imgTitle = this.myTitle ? this.myTitle : "无title";
var tooltip = "

" + this.imgTitle + ""
$("body").append(tooltip);
$("#tooltip").css({
"top": +(e.pageY + y) + "px",
"left": +(e.pageX + x) + "px"
}).show("fast");
}).mouseout(function () {
$("#tooltip").remove();
this.title = this.myTitle;
})
script>