This example describes the use of the jquery hints effect. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
<p><a href= "#" class= "tooltip" title= "This is my hyperlink tip 1." > Tips 1.</a></p>
<p><a href= "#" class= "tooltip" title= "This is my hyperlink tip 2." > Tips 2.</a></p>
<p><a href= "#" title= "This is a tip 1." > With tips 1.</a></p>
<p><a href= "#" title= "This is a tip 2." > With tips 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 ();
});
})
Experience:
Do not append the div element under the P tag, there will be a large deviation value!
Originally! This and $ ("this") are different if the above this.title is rewritten to $ ("this"). attr ("title") can cause the following Mouseout event to not access the saved title.
I hope this article will help you with your jquery programming.