/
dynamic.html
105 lines (83 loc) · 2.44 KB
/
dynamic.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<script src="../../lib/jquery-1.7.1.js"></script>
<script src="../../src/tooltip/tooltip.js"></script>
<script src="../../src/tooltip/tooltip.dynamic.js"></script>
<style type="text/css">
body {
padding:30px;
}
div.tip {
background:#000 url(../../../../www/trunk/web/tools/img/tooltip/black.png) 0 0 no-repeat;
display:none;
width:165px;
height:63px;
position:absolute;
padding:20px;
color:#fff;
}
a.tip, a.titled {
border:1px solid blue;
display:blocK;
padding:10px;
width:100px;
margin:0px;
margin-bottom:5px;
}
</style>
<!--[if IE]>
<style>
div.tip {
filter: Alpha(opacity=40);
zoom:1;
}
</style>
<![endif]-->
<script>
$(function() {
// base configuration
var conf = {
tip: '#tip',
position: ['top', 'left'],
offset: [-10, -10]
};
// topleft
$(".titled:eq(0)").tooltip(conf);
$(".titled:eq(1)").tooltip($.extend({}, conf)).dynamic();
// topright
conf = $.extend(conf, {position: ['top', 'right'], effect: 'toggle', offset: [-10, 10]})
$(".titled:eq(2)").tooltip(conf);
$(".titled:eq(3)").tooltip($.extend({}, conf)).dynamic();
// bottomleft
conf = $.extend(conf, {position: ['bottom', 'left'], effect: 'toggle', offset: [10, -10]})
$(".titled:eq(4)").tooltip(conf);
$(".titled:eq(5)").tooltip($.extend({}, conf)).dynamic();
// bottomright
conf = $.extend(conf, {position: ['bottom', 'right'], effect: 'toggle', offset: [10, 10]})
$(".titled:eq(6)").tooltip(conf);
$(".titled:eq(7)").tooltip($.extend({}, conf)).dynamic();
});
</script>
<p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>
<table border="0" width="100%" height="100%">
<tr>
<td valign="top">
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
</td>
<td align="right" valign="top">
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
</td>
</tr>
<tr>
<td valign="bottom">
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
</td>
<td align="right" valign="bottom">
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
<a href="#" title="jotain tippiä #1" class="titled">jtoainv</a>
</td>
</tr>
</table>
<div id="tip" class="tip"></div>