超链接提示效果: 复制代码 代码如下: <BR>//<![CDATA[ <BR>$(function(){ <BR>var x = 10; <BR>var y = 20; <BR>$("a.tooltip").mouseover(function(e){ <BR>this.myTitle = this.title; <BR>this.title = ""; <BR>var tooltip = "<div id='tooltip'>"+ this.myTitle +"<\/div>"; //创建 div 元素 <BR>$("body").append(tooltip); //把它追加到文档中 <BR>$("#tooltip") <BR>.css({ <BR>"top": (e.pageY+y) + "px", <BR>"left": (e.pageX+x) + "px" <BR>}).show("fast"); //设置x坐标和y坐标,并且显示 <BR>}).mouseout(function(){ <BR>this.title = this.myTitle; <BR>$("#tooltip").remove(); //移除 <BR>}).mousemove(function(e){ <BR>$("#tooltip") <BR>.css({ <BR>"top": (e.pageY+y) + "px", <BR>"left": (e.pageX+x) + "px" <BR>}); <BR>}); <BR>}) <BR>//]]> <BR> 图片提示效果: 复制代码 代码如下: <BR>//<![CDATA[ <BR>$(function(){ <BR>var x = 10; <BR>var y = 20; <BR>$("a.tooltip").mouseover(function(e){ <BR>this.myTitle = this.title; <BR>this.title = ""; <BR>var imgTitle = this.myTitle? "<br/>" + this.myTitle : ""; <BR>var tooltip = "<div id='tooltip'><img src='"+ this.href +"' alt='产品预览图'/>"+imgTitle+"<\/div>"; //创建 div 元素 <BR>$("body").append(tooltip); //把它追加到文档中 <BR>$("#tooltip") <BR>.css({ <BR>"top": (e.pageY+y) + "px", <BR>"left": (e.pageX+x) + "px" <BR>}).show("fast"); //设置x坐标和y坐标,并且显示 <BR>}).mouseout(function(){ <BR>this.title = this.myTitle; <BR>$("#tooltip").remove(); //移除 <BR>}).mousemove(function(e){ <BR>$("#tooltip") <BR>.css({ <BR>"top": (e.pageY+y) + "px", <BR>"left": (e.pageX+x) + "px" <BR>}); <BR>}); <BR>}) <BR>//]]> <BR>