<P> <a href = "#" class = "tooltip" Title = "this is my hyperlink prompt 1. "> prompt 1. </a> </P> <p> <a href = "#" class = "tooltip" Title = "this is my hyperlink prompt 2. "> note 2. </a> </P> <p> <a href = "#" Title = "this is the built-in prompt 1. "> built-in prompt 1. </a> </P> <p> <a href = "#" Title = "this is the built-in prompt 2. "> built-in prompt 2. </a> </P>
$(function(){ $(".tooltip").mouseenter(function(e){ this.mytitle=this.title this.title="" var a="<div>"+this.mytitle+"</div>" $("body").append(a); $("div").css({ "top": (e.pageY + y) + "px", "left": (e.pageX + x) + "px" }).show("fast") }).mouseout(function(){ this.title= this.mytitle; $("div").remove(); }); })
Learning Experience:
Do not append the DIV element under the P tag. A large deviation value is displayed!
Originally! This and $ ("this") are different.
This. Title is rewritten to $ ("this"). ATTR ("title ")
The following mouseout events cannot access the saved title.
[JQ Study Notes] tips