Skip to content

Commit 426b78f

Browse files
committed
update node project
1 parent 0da1207 commit 426b78f

File tree

2 files changed

+79
-51
lines changed

2 files changed

+79
-51
lines changed

jquery/.idea/workspace.xml

Lines changed: 12 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<title>文字提示</title>
6+
<!-- 引入jQuery -->
7+
<script src="../../scripts/jquery.js" type="text/javascript"></script>
8+
<style type="text/css">
9+
body{
10+
margin:0;
11+
padding:40px;
12+
background:#fff;
13+
font:80% Arial, Helvetica, sans-serif;
14+
color:#555;
15+
line-height:180%;
16+
}
17+
p{
18+
clear:both;
19+
margin:0;
20+
padding:.5em 0;
21+
}
22+
/* tooltip */
23+
#tooltip{
24+
position:absolute;
25+
border:1px solid #333;
26+
background:#f7f5d1;
27+
padding:1px;
28+
color:#333;
29+
display:none;
30+
}
31+
</style>
32+
<script type="text/javascript">
33+
//<![CDATA[
34+
$(function(){
35+
var x = 10;
36+
var y = 20;
37+
$("a.tooltip").mouseover(function(e){
38+
this.myTitle = this.title;
39+
this.title = "";
40+
var tooltip = "<div id='tooltip'>"+ this.myTitle +"<\/div>"; //创建 div 元素
41+
$("body").append(tooltip); //把它追加到文档中
42+
$("#tooltip")
43+
.css({
44+
"top": (e.pageY+y) + "px",
45+
"left": (e.pageX+x) + "px"
46+
}).show("fast"); //设置x坐标和y坐标,并且显示
47+
}).mouseout(function(){
48+
this.title = this.myTitle;
49+
$("#tooltip").remove(); //移除
50+
}).mousemove(function(e){
51+
$("#tooltip")
52+
.css({
53+
"top": (e.pageY+y) + "px",
54+
"left": (e.pageX+x) + "px"
55+
});
56+
});
57+
})
58+
//]]>
59+
</script>
60+
</head>
61+
<body>
62+
<p><a href="#" class="tooltip" title="这是我的超链接提示1.">提示1.</a></p>
63+
<p><a href="#" class="tooltip" title="这是我的超链接提示2.">提示2.</a></p>
64+
<p><a href="#" title="这是自带提示1.">自带提示1.</a></p>
65+
<p><a href="#" title="这是自带提示2.">自带提示2.</a> </p>
66+
</body>
67+
</html>

0 commit comments

Comments
 (0)