-
Notifications
You must be signed in to change notification settings - Fork 3
/
dontdothis.html
59 lines (50 loc) · 1.41 KB
/
dontdothis.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
<title>I'm just gonna roll my own tooltip for no reason!</title>
<style>
body { font-size:1.5em; background: #fff;}
#tooltip { border:3px solid #000; background: #bada55; }
</style>
</head>
<body>
<header>
<h4>Check Out My Awesome, Hand-Rolled Tooltip!</h4>
</header>
<ul>
<li><span>Mouse</span></li>
<li><span>Over</span></li>
<li><span>For</span></li>
<li><span>Great</span></li>
<li><span>Success</span></li>
</ul>
<div id='tooltip'>
I just went into an element that says <span>something</span>
</div>
<script src="js/jquery.js"></script>
<script>
$(document).ready(function() {
var tip = $("#tooltip").css("position","absolute").hide(),
span = tip.find("span");
$("ul li span").hover(function(e) {
var $t = $(this),
w = $t.width(),
o = $t.offset();
o.left = o.left + w;
span.text($t.text())
tip.offset(o).show();
alert(o);
},function(e) {
tip.hide();
});
/*
if (confirm("Are You Ready For This")) {
}
*/
});
</script>
</body>
</html>