Home  >  Article  >  Web Front-end  >  jquery提示效果实例分析_jquery

jquery提示效果实例分析_jquery

WBOY
WBOYOriginal
2016-05-16 16:30:291210browse

本文实例讲述了jquery提示效果的用法。分享给大家供大家参考。具体实现方法如下:

复制代码 代码如下:

提示1.


提示2.


自带提示1.


自带提示2.

$(function(){
    $(".tooltip").mouseenter(function(e){
 this.mytitle=this.title
 this.title=""
 var a="

"+this.mytitle+"
"
 $("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();
     });
})

心得体会:

不要在p标签下追加div元素,会出现一个大的偏差值!

原来!this和$("this")是有所不同,如果上文this.title改写成$("this").attr("title")会导致下面的mouseout事件无法访问保存下来的title。

希望本文所述对大家的jQuery程序设计有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn