<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自定义Title</title>
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script tyep='text/javascript'>
$(document).ready(function(){
//自定义title内容
var x = 10;
var y = 20;
$("a.tooltip").mouseover(function(e){
this.myTitle = this.title;
this.title = "";
var tooltip = "<div id='tooltip'>"+this.myTitle+"</div>";
$("body").append(tooltip);
$("#tooltip").
css({
"top":(e.pageY+y)+"px",
"left":(e.pageX+x)+"px"
}).show("fast");
}).mouseout(function(){
this.title = this.myTitle;
$("#tooltip").remove();
}).mousemove(functio
使用jQuery实现自定义tooltip
最新推荐文章于 2020-06-16 16:31:39 发布