Skip to content

Commit 0da1207

Browse files
committed
update node project
1 parent fb8b824 commit 0da1207

File tree

3 files changed

+90
-20
lines changed

3 files changed

+90
-20
lines changed

jquery/.idea/workspace.xml

Lines changed: 29 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery/ch3/3-13案例研究-超链接提示和图片提示效果/1-1-文字提示-第一步.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</style>
3333
<script type="text/javascript">
3434
$(document).ready(function () {
35-
$("a.tooltip").onmouseover(function (e) {
35+
$("a.tooltip").mouseover(function (e) {
3636
var tooltip = "<div id='tooltip'>"+this.title+ "<\/div>" ; // div 创建
3737
$("body").append(tooltip);
3838

@@ -41,7 +41,7 @@
4141
"left":e.payX+"px"
4242
}).show("fast"); // 设置 X,Y坐标并且显示
4343

44-
}).onmouseout(function () {
44+
}).mouseout(function () {
4545
$("#tooltip").remove(); // 移除
4646
});
4747
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2+
"http://www.w3.org/TR/html4/loose.dtd">
3+
<html>
4+
<head>
5+
<title>文字提示</title>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7+
<!-- 引入jQuery -->
8+
<script src="../../scripts/jquery.js" type="text/javascript"></script>
9+
<style type="text/css">
10+
body{
11+
margin:0;
12+
padding:40px;
13+
background:#fff;
14+
font:80% Arial, Helvetica, sans-serif;
15+
color:#555;
16+
line-height:180%;
17+
}
18+
p{
19+
clear:both;
20+
margin:0;
21+
padding:.5em 0;
22+
}
23+
/* tooltip */
24+
#tooltip{
25+
position:absolute;
26+
border:1px solid #333;
27+
background:#f7f5d1;
28+
padding:1px;
29+
color:#333;
30+
display:none;
31+
}
32+
</style>
33+
<script type="text/javascript">
34+
$(function () {
35+
36+
var x = 10;
37+
var y = 20;
38+
$("a.tooltip").mouseover(function (e) {
39+
this.myTitle = this.title;
40+
this.title = "";
41+
var tooltip = "<div id='tooltip'>"+this.myTitle+"<\/div>" // 创建div 元素
42+
$("body").append(tooltip); // 追加到文档中
43+
$("#tooltip").css({"top":(e.pageY+y)+"px",
44+
left:(e.pageX+x)+"px"}).show("fast");}).mouseout(function () {
45+
this.title = this.myTitle;
46+
$("#tooltip").remove();
47+
}) ;
48+
49+
})
50+
51+
</script>
52+
</head>
53+
<body>
54+
<p><a href="#" class="tooltip" title="这是我的超链接提示1.">提示1.</a></p>
55+
<p><a href="#" class="tooltip" title="这是我的超链接提示2.">提示2.</a></p>
56+
<p><a href="#" title="这是自带提示1.">自带提示1.</a></p>
57+
<p><a href="#" title="这是自带提示2.">自带提示2.</a></p>
58+
</body>
59+
</html>

0 commit comments

Comments
 (0)