-
Notifications
You must be signed in to change notification settings - Fork 2
/
tooltips.html
294 lines (245 loc) · 16.7 KB
/
tooltips.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!-- This page is admittedly lazy/crappy. Don't think the plugin shares it's quality, because it doesn't -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=0.86, maximum-scale=3.0, minimum-scale=0.86">
<meta name="docsearch:language" content="en">
<meta name="docsearch:version" content="5">
<meta name="description" content="Bootstrap Extra is a free and advanced open source front end development framework for the creation of websites and web apps.">
<meta name="keywords" content="HTML, CSS, JavaScript, Responsive, Mobile, App, Jquery">
<meta name="author" content="Irfan Ghuori">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="plugin/jTippy/jTippy.css">
<!-- Favicon /-->
<link rel="apple-touch-icon" sizes="57x57" href="./images/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./images/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./images/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./images/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./images/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./images/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./images/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./images/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./images/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./images/favicon/favicon-16x16.png">
<link rel="manifest" href="./images/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="./images/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- Favicon \ -->
<title>Bootstrap Extra</title>
<!-- Fonts and icons -->
</head>
<body>
<div class="container">
<br>
<div class="card text-center">
<div class="card-header"><span class="display-7"> Tooltip's </span> <br> <a href="https://github.com/HTMLGuyLLC/jTippy" target="_blank" rel="noreferrer">Learn more on
Github</a></div>
<div class="card-body">
<div style="margin-top: 50px;">
Trigger:<br>
<a href="#" data-toggle="tooltip" data-trigger="click" class="btn btn-light">Click</a>
<a href="#" data-toggle="tooltip" data-trigger="hover" class="btn btn-light">Hover</a>
<a href="#" data-toggle="tooltip" data-trigger="focus" class="btn btn-light">Focus</a>
<a href="#" data-toggle="tooltip" data-trigger="hoverfocus" class="btn btn-light">HoverFocus</a>
</div>
<div style="margin-top: 50px;">
Backdrops (only works with click trigger):<br>
<a href="#" data-toggle="tooltip" data-trigger="click" data-backdrop="black" class="btn btn-light">Black</a>
<a href="#" data-toggle="tooltip" data-trigger="click" data-backdrop="white" class="btn btn-light">White</a>
<a href="#" data-toggle="tooltip" data-trigger="click" data-backdrop="blurred" class="btn btn-light">Blurred</a>
</div>
<div style="margin-top: 50px" class="text-center">
<table class="table" style="max-width: 500px; display: inline-block;">
<tr>
<th colspan="2"></th>
<th colspan="4" style="text-align: center;">Preferred Placement</th>
</tr>
<tr>
<td></td>
<td></td>
<td>Top</td>
<td>Bottom</td>
<td>Left</td>
<td>Right</td>
</tr>
<tr>
<th rowspan="4" style="vertical-align: middle">Sizes</th>
<td>Tiny</td>
<td><a href="#" data-toggle="tooltip" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="tiny" data-position="bottom" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="tiny" data-position="left" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="tiny" data-position="right" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Small</td>
<td><a href="#" data-toggle="tooltip" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="small" data-position="bottom" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="small" data-position="left" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="small" data-position="right" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Medium</td>
<td><a href="#" data-toggle="tooltip" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="medium" data-position="bottom" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="medium" data-position="left" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="medium" data-position="right" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Large</td>
<td><a href="#" data-toggle="tooltip" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="large" data-position="bottom" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="large" data-position="left" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-size="large" data-position="right" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
</table>
</div>
<div style="margin-top: 20px" class="text-center">
<table class="table table-inline" style="max-width: 500px; display: inline-block;">
<tr>
<th colspan="2"></th>
<th colspan="6" style="text-align: center;">Themes</th>
</tr>
<tr>
<td></td>
<td></td>
<td>Black</td>
<td>Lt-Gray</td>
<td>White</td>
<td>Blue</td>
<td>Green</td>
<td>Red</td>
</tr>
<tr>
<th rowspan="4" style="vertical-align: middle">Sizes</th>
<td>Tiny</td>
<td><a href="#" data-toggle="tooltip" data-theme="black" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="lt-gray" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="white" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="blue" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="green" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="red" data-size="tiny" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Small</td>
<td><a href="#" data-toggle="tooltip" data-theme="black" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="lt-gray" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="white" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="blue" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="green" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="red" data-size="small" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Medium</td>
<td><a href="#" data-toggle="tooltip" data-theme="black" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="lt-gray" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="white" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="blue" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="green" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="red" data-size="medium" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
<tr>
<td>Large</td>
<td><a href="#" data-toggle="tooltip" data-theme="black" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="lt-gray" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="white" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="blue" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="green" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
<td><a href="#" data-toggle="tooltip" data-theme="red" data-size="large" data-position="top" class="btn btn-light"><i class="idea"></i></a></td>
</tr>
</table>
</div>
<div style="text-align: center;">
<br><br>
<hr>
<h2>Documentation</h2>
<hr><br>
<h4>All options and events with defaults:</h4>
<div>
<pre style="display:inline-block;width:800px;max-width:100%; text-align:left;"><code class="javascript">
$(function(){
$('[data-toggle="tooltip"]').jTippy({
//string/function(btn, jtippy):string - overridden by the title attribute - function is run every time the tooltip is displayed and can be used to grab content via XHR/AJAX
title: '',
//string ('click', 'hover', 'focus', 'hoverfocus'): defines when the tooltip should be shown
trigger: 'hoverfocus',
//string ('auto','top','bottom','left','right'): preferred location of the tooltip (defaults to auto if no space)
position: 'auto',
//string ('black', 'lt-gray', 'white', 'blue', 'green', 'red')
theme: 'black',
//string ('tiny', 'small', 'medium', 'large')
size: 'small',
//string|false ('black', 'white', 'blurred'): Only works with trigger: "click"
backdrop: false,
//string: class(es) to add to the tooltip
'class': '',
//boolean: if true, when this tooltip is triggered, all others will hide
singleton: true,
//boolean: if true and trigger: 'click', when clicking outside the tooltip, it will be hidden
close_on_outside_click: true,
}).on('jt-show', function(e, tooltip, hide){
//triggered on show of tooltip
//the tooltip's jquery dom object is provided as the second param
//to hide the tooltip, run hide()
}).on('jt-hide', function(e){
//triggered on hide of tooltip
});
});
</code></pre>
</div>
</div>
<div style="margin-top: 10px; margin-bottom: 100px; text-align: center;">
<div style="max-width: 800px;display:inline-block; ">
<h4>All options can be set globally:</h4>
<div>
<pre style="text-align:left;width:800px;max-width:100%;"><code class="javascript">
$.jTippy.defaults.backdrop = false;
$.jTippy.defaults.theme = 'black';
$.jTippy.defaults.trigger = 'hover';
</code></pre>
</div>
<h4>All options can be set with data attributes:</h4>
<pre style="text-align:left;width:800px;max-width:100%;"><code class="html">
<a href='#'
data-toggle="tooltip"
data-backdrop="black">
Black backdrop!
</a>
</code></pre>
<div>
<pre style="text-align:left;width:800px;max-width:100%;"><code class="javascript">
$('[data-toggle="tooltip"]').jTippy();
</code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Page title -->
<!-- jQuery and script -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="plugin/jTippy/jTippy.min.js"></script>
<script>
$(function() {
$('[data-toggle="tooltip"]').jTippy({
title: 'Hey! I\'m a tooltip!',
}).on('jt-show', function(e, tooltip) {
// console.log('Shown');
// console.log(tooltip);
}).on('jt-hide', function() {
// console.log('Hidden');
});
})
const img = '<img style="width: 20px; height: 20px;" src="images/idea.png" alt="idea">';
$('.idea').html(img);
</script>
</body>
</html>