Jquery prompts for result instance analysis, and jquery prompts for instance analysis
This article describes how to use jquery prompts. Share it with you for your reference. The specific implementation method is as follows:
Copy codeThe Code is as follows: <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."> Tip 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 ();
$ ("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. A large deviation value is displayed!
Originally! This is different from $ ("this. rewrite the title to $ ("this "). attr ("title") will make the following mouseout event unable to access the saved title.
I hope this article will help you with jQuery programming.