/
demo.html
689 lines (591 loc) · 28 KB
/
demo.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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Poshy Tip jQuery Plugin Demo Page</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<!-- Tooltip classes -->
<link rel="stylesheet" href="../src/tip-yellow/tip-yellow.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-violet/tip-violet.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-darkgray/tip-darkgray.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-skyblue/tip-skyblue.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-yellowsimple/tip-yellowsimple.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-twitter/tip-twitter.css" type="text/css" />
<link rel="stylesheet" href="../src/tip-green/tip-green.css" type="text/css" />
<!-- jQuery and the Poshy Tip plugin files -->
<script type="text/javascript" src="includes/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../src/jquery.poshytip.js"></script>
<!-- Setup examples on this page -->
<script type="text/javascript">
//<![CDATA[
$(function(){
$('#demo-basic').poshytip();
$('#demo-tip-yellow').poshytip();
$('#demo-tip-violet').poshytip({
className: 'tip-violet',
bgImageFrameSize: 9
});
$('#demo-tip-darkgray').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
offsetX: -25
});
$('#demo-tip-skyblue').poshytip({
className: 'tip-skyblue',
bgImageFrameSize: 9,
offsetX: 0,
offsetY: 20
});
$('#demo-tip-yellowsimple').poshytip({
className: 'tip-yellowsimple',
showTimeout: 1,
alignTo: 'target',
alignX: 'center',
offsetY: 5,
allowTipHover: false
});
$('#demo-tip-twitter').poshytip({
className: 'tip-twitter',
showTimeout: 1,
alignTo: 'target',
alignX: 'center',
offsetY: 5,
allowTipHover: false,
fade: false,
slide: false
});
$('#demo-tip-green').poshytip({
className: 'tip-green',
offsetX: -7,
offsetY: 16,
allowTipHover: false
});
$('#demo-form-name').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});
$('#demo-form-email').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'left',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});
$('#demo-form-site').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'inner-left',
offsetX: 0,
offsetY: 5,
showTimeout: 100
});
$('#demo-form-subject').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetX: 0,
offsetY: 5,
showTimeout: 100
});
$('#demo-async-timeout').poshytip({
content: function(updateCallback) {
window.setTimeout(function() {
updateCallback('Tooltip content updated!');
}, 1000);
return 'Loading...';
}
});
var flickrFeedsCache = {};
$('#demo-async-flickr > a').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
alignY: 'bottom',
content: function(updateCallback) {
var rel = $(this).attr('rel');
if (flickrFeedsCache[rel] && flickrFeedsCache[rel].container)
return flickrFeedsCache[rel].container;
if (!flickrFeedsCache[rel]) {
flickrFeedsCache[rel] = { container: null };
var tagsComma = rel.substring(4).replace('-', ',');
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?tags=' + tagsComma + '&tagmode=all&format=json&jsoncallback=?',
function(data) {
var container = $('<div/>').addClass('flickr-thumbs');
$.each(data.items, function(i, item) {
$('<a/>')
.attr('href', item.link)
.append($('<img/>').attr('src', item.media.m))
.appendTo(container)
.data('tip', '<strong>' + (item.title || '(no title)') + '</strong><br />by: ' + item.author.match(/\((.*)\)/)[1]);
if (i == 4)
return false;
});
// add tips for the images inside the main tip
container.find('a').poshytip({
content: function(){return $(this).data('tip');},
className: 'tip-yellowsimple',
showTimeout: 100,
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetY: 5,
allowTipHover: false,
hideAniDuration: 0
});
// call the updateCallback function to update the content in the main tooltip
// and also store the content in the cache
updateCallback(flickrFeedsCache[rel].container = container);
}
);
}
return 'Loading images...';
}
});
$('#demo-follow-cursor').poshytip({
followCursor: true,
slide: false
});
$('#demo-manual-trigger').poshytip({
content: 'Hey, there! This is a tooltip.',
showOn: 'none',
alignTo: 'target',
alignX: 'inner-left',
offsetX: 0,
offsetY: 5
});
$('#button-show').click(function() { $('#demo-manual-trigger').poshytip('show'); });
$('#button-show-delayed').click(function() { $('#demo-manual-trigger').poshytip('showDelayed', 2000); });
$('#button-hide').click(function() { $('#demo-manual-trigger').poshytip('hide'); });
$('#button-hide-delayed').click(function() { $('#demo-manual-trigger').poshytip('hideDelayed', 2000); });
$('#button-update').click(function() { $('#demo-manual-trigger').poshytip('update', 'I am a new content :)'); });
$('#button-disable').click(function() { $('#demo-manual-trigger').poshytip('disable'); });
$('#button-enable').click(function() { $('#demo-manual-trigger').poshytip('enable'); });
$('#button-destroy').click(function() { $('#demo-manual-trigger').poshytip('destroy'); });
$('#demo-live-events > a').poshytip({
liveEvents: true
});
$('#button-live-events').click(function() {
$('#demo-live-events').append(', <a title="Hey, there! This is a tooltip." href="#">Hover for a tooltip</a>');
});
});
//]]>
</script>
<style type="text/css">
.flickr-thumbs {
overflow:hidden;
}
.flickr-thumbs a {
float:left;
display:block;
margin:0 3px;
border:1px solid #333;
}
.flickr-thumbs a:hover {
border-color:#eee;
}
.flickr-thumbs img {
display:block;
width:60px;
height:60px;
}
</style>
<!-- Neglect these files - they are used just to make the demo page prettier -->
<link rel="stylesheet" href="includes/demos.css" type="text/css" />
<script type="text/javascript" src="includes/sh_main.min.js"></script>
<script type="text/javascript" src="includes/demos.js"></script>
</head>
<body>
<div id="holder">
<div id="nav">
<h2>Demo Page Navigation</h2>
<ul>
<li class="first"><a href="#examples">Usage Examples</a>
<ul>
<li><a href="#styles">Styles (Classes)</a></li>
<li><a href="#form-tooltips">Form Tooltips (with varying positioning)</a></li>
<li><a href="#async-content">Asynchronous Loading of the Content</a>
<ul>
<li><a href="#async-simple">Simple Example</a></li>
<li><a href="#async-flickr-feeds">Loading Flickr Feeds</a></li>
</ul>
</li>
<li><a href="#follow-cursor">Following the Mouse Cursor</a></li>
<li><a href="#manual-trigger">API Example - Triggering the Tooltip Manually</a></li>
<li><a href="#live-events">Using Live Events</a></li>
</ul>
</li>
<li><a href="#options">Options</a></li>
<li><a href="#methods">Methods</a></li>
<li><a href="#notes">Notes</a></li>
<li><a href="#license">License</a></li>
<li><a href="#download">Download</a></li>
<li><a href="#support">Support</a></li>
<li class="last"><a href="#donate">Donate</a></li>
</ul>
<h2>Next?</h2>
<ul>
<li class="first"><a href="http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/">« Back to the Poshy Tip Page</a></li>
<li class="last"><a href="http://vadikom.com/">« Back to Vadikom.com</a></li>
</ul>
</div>
<div id="content">
<h1>Poshy Tip jQuery Plugin <span>Demo Page</span></h1>
<h2 id="examples">Usage Examples</h2>
<p>The default browser tooltip that displays the value of the <code>title</code> attribute is replaced with a "poshier" version:</p>
<!-- #demo-basic -->
<p><a id="demo-basic" title="Hey, there! This is a tooltip." href="#">Hover for a tooltip</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-basic').poshytip();</pre>
</div>
<h3 id="styles">Styles (Classes)</h3>
<p>Using different tooltip classes is easy. Here are some examples that are included in the download package (in the "src" folder).</p>
<!-- #demo-tip-yellow -->
<p><a id="demo-tip-yellow" title="Hey, there! This is a tooltip." href="#">.tip-yellow</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-yellow').poshytip();</pre>
</div>
<!-- #demo-tip-violet -->
<p><a id="demo-tip-violet" title="Hey, there! This is a tooltip." href="#">.tip-violet</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-violet').poshytip({
className: 'tip-violet',
bgImageFrameSize: 9
});</pre>
</div>
<!-- #demo-tip-darkgray -->
<p><a id="demo-tip-darkgray" title="Hey, there! This is a tooltip." href="#">.tip-darkgray</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-darkgray').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
offsetX: -25
});</pre>
</div>
<!-- #demo-tip-skyblue -->
<p><a id="demo-tip-skyblue" title="Hey, there! This is a tooltip." href="#">.tip-skyblue</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-skyblue').poshytip({
className: 'tip-skyblue',
bgImageFrameSize: 9,
offsetX: 0,
offsetY: 20
});</pre>
</div>
<!-- #demo-tip-yellowsquare -->
<p><a id="demo-tip-yellowsimple" title="Hey, there! This is a tooltip." href="#">.tip-yellowsimple</a> (no background-image used for the tooltip body)</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-yellowsimple').poshytip({
className: 'tip-yellowsimple',
showTimeout: 1,
alignTo: 'target',
alignX: 'center',
offsetY: 5,
allowTipHover: false
});</pre>
</div>
<!-- #demo-tip-twitter -->
<p><a id="demo-tip-twitter" title="Follow vadikom" href="#">.tip-twitter</a> (ala Twitter)</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-twitter').poshytip({
className: 'tip-twitter',
showTimeout: 1,
alignTo: 'target',
alignX: 'center',
offsetY: 5,
allowTipHover: false,
fade: false,
slide: false
});</pre>
</div>
<!-- #demo-tip-green -->
<p><a id="demo-tip-green" title="Hey, there! This is a tooltip." href="#">.tip-green</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-tip-green').poshytip({
className: 'tip-green',
offsetX: -7,
offsetY: 16,
allowTipHover: false
});</pre>
</div>
<h3 id="form-tooltips">Form Tooltips (with varying positioning)</h3>
<p>Adding form input field tooltips is simple. You just have to make sure they are triggered on focus/blur (i.e. <code>showOn: 'focus'</code>) and positioned relatively to the target element (i.e. <code>alignTo: 'target'</code>). The script also updates the position of such tooltips if the window is resized (e.g. show some of the tips below and resize your browser window for a demo).</p>
<!-- #demo-form-name -->
<p>
<label for="demo-form-name">Name:</label><br />
<input id="demo-form-name" type="text" size="30" title="Enter your name" />
</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-form-name').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'right',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});</pre>
</div>
<!-- #demo-form-email -->
<p>
<label for="demo-form-email">Email:</label><br />
<input id="demo-form-email" type="text" size="30" title="Enter a valid email" />
</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-form-email').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'left',
alignY: 'center',
offsetX: 5,
showTimeout: 100
});</pre>
</div>
<!-- #demo-form-site -->
<p>
<label for="demo-form-site">Site:</label><br />
<input id="demo-form-site" type="text" size="30" title="Enter your website URL" />
</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-form-site').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'inner-left',
offsetX: 0,
offsetY: 5,
showTimeout: 100
});</pre>
</div>
<!-- #demo-form-subject -->
<p>
<label for="demo-form-subject">Subject:</label><br />
<input id="demo-form-subject" type="text" size="30" title="Enter a subject" />
</p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-form-subject').poshytip({
className: 'tip-yellowsimple',
showOn: 'focus',
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetX: 0,
offsetY: 5,
showTimeout: 100
});</pre>
</div>
<h3 id="async-content">Asynchronous Loading of the Content</h3>
<p>Poshy Tip supports using a function for returning the tooltip content and the script also passes an update callback function as an argument to this function. By using this callback, you can easily update asynchronously the content of the tooltip after it has been displayed. The script also recalculates and updates the position of the tooltip when its content is updated.</p>
<h4 id="async-simple">Simple Example</h4>
<!-- #demo-async-timeout -->
<p><a id="demo-async-timeout" href="#">Update content after 1 second</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-async-timeout').poshytip({
content: function(updateCallback) {
window.setTimeout(function() {
updateCallback('Tooltip content updated!');
}, 1000);
return 'Loading...';
}
});</pre>
</div>
<h4 id="async-flickr-feeds">Loading Flickr Feeds</h4>
<p>A more complicated example of loading some Flickr images by tags:</p>
<!-- #demo-async-flickr -->
<p id="demo-async-flickr"><a rel="tag-flowers-closeup" href="#">flowers, closeup</a>, <a rel="tag-sunset" href="#">sunset</a>, <a rel="tag-architecture" href="#">architecture</a>, <a rel="tag-Plovdiv-old-town" href="#">Plovdiv, old, town</a>, <a rel="tag-Nesebar" href="#">Nesebar</a>, <a rel="tag-depeche" href="#">depeche</a></p>
<div class="code-block">
<pre class="sh_javascript">var flickrFeedsCache = {};
$('#demo-async-flickr > a').poshytip({
className: 'tip-darkgray',
bgImageFrameSize: 11,
alignY: 'bottom',
content: function(updateCallback) {
var rel = $(this).attr('rel');
if (flickrFeedsCache[rel] && flickrFeedsCache[rel].container)
return flickrFeedsCache[rel].container;
if (!flickrFeedsCache[rel]) {
flickrFeedsCache[rel] = { container: null };
var tagsComma = rel.substring(4).replace('-', ',');
$.getJSON('http://api.flickr.com/services/feeds/photos_public.gne?tags=' + tagsComma + '&tagmode=all&format=json&jsoncallback=?',
function(data) {
var container = $('<div/>').addClass('flickr-thumbs');
$.each(data.items, function(i, item) {
$('<a/>')
.attr('href', item.link)
.append($('<img/>').attr('src', item.media.m))
.appendTo(container)
.data('tip', '<strong>' + (item.title || '(no title)') + '</strong><br />by: ' + item.author.match(/\((.*)\)/)[1]);
if (i == 4)
return false;
});
// add tips for the images inside the main tip
container.find('a').poshytip({
content: function(){return $(this).data('tip');},
className: 'tip-yellowsimple',
showTimeout: 100,
alignTo: 'target',
alignX: 'center',
alignY: 'bottom',
offsetY: 5,
allowTipHover: false,
hideAniDuration: 0
});
// store the content in the cache
// and call updateCallback() to update the content in the main tooltip
updateCallback(flickrFeedsCache[rel].container = container);
}
);
}
return 'Loading images...';
}
});</pre>
</div>
<h3 id="follow-cursor">Following the Mouse Cursor</h3>
<p>If using the <code>followCursor: true</code> option, it's better to make sure the the slide animation effect is disabled (i.e. <code>slide: false</code>) so that it doesn't conflict with the code that moves the tooltip with the cursor.</p>
<!-- #demo-follow-cursor -->
<p><a id="demo-follow-cursor" title="Hey, there! This is a tooltip." href="#">Hover for a tooltip that follows the cursor</a></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-follow-cursor').poshytip({
followCursor: true,
slide: false
});</pre>
</div>
<h3 id="manual-trigger">API Example - Triggering the Tooltip Manually</h3>
<p>If you like, you can add a tooltip to some element(s) and configure it to not be triggered automatically on hover or focus/blur by using the <code>showOn: 'none'</code> option. You can then control the tooltip manually via the available methods.</p>
<!-- #demo-manual-trigger -->
<p><a id="demo-manual-trigger" href="#">This link has a tooltip that is not triggered automatically</a></p>
<p><button id="button-show">Show</button> <button id="button-show-delayed">Show in 2 sec.</button> <button id="button-hide">Hide</button> <button id="button-hide-delayed">Hide in 2 sec.</button> <button id="button-update">Update Content</button> <button id="button-disable">Disable</button> <button id="button-enable">Enable</button> <button id="button-destroy">Destroy</button></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-manual-trigger').poshytip({
content: 'Hey, there! This is a tooltip.',
showOn: 'none',
alignTo: 'target',
alignX: 'inner-left',
offsetX: 0,
offsetY: 5
});
$('#button-show').click(function() { $('#demo-manual-trigger').poshytip('show'); });
$('#button-show-delayed').click(function() { $('#demo-manual-trigger').poshytip('showDelayed', 2000); });
$('#button-hide').click(function() { $('#demo-manual-trigger').poshytip('hide'); });
$('#button-hide-delayed').click(function() { $('#demo-manual-trigger').poshytip('hideDelayed', 2000); });
$('#button-update').click(function() { $('#demo-manual-trigger').poshytip('update', 'I am a new content :)'); });
$('#button-disable').click(function() { $('#demo-manual-trigger').poshytip('disable'); });
$('#button-enable').click(function() { $('#demo-manual-trigger').poshytip('enable'); });
$('#button-destroy').click(function() { $('#demo-manual-trigger').poshytip('destroy'); });</pre>
</div>
<h3 id="live-events">Using Live Events</h3>
<p>You can set the <code>liveEvents: true</code> option to use live events. Note that the API methods (except 'destroy') won't work reliably in such case. They will only work for the elements for which the tooltip has been initialized (i.e. shown at least once). Live events are supported in jQuery 1.4.2+.</p>
<!-- #demo-live-events -->
<p id="demo-live-events"><a title="Hey, there! This is a tooltip." href="#">Hover for a tooltip</a></p>
<p><button id="button-live-events">Add Another Link</button></p>
<div class="code-block">
<pre class="sh_javascript">$('#demo-live-events > a').poshytip({
liveEvents: true
});
$('#button-live-events').click(function() {
$('#demo-live-events').append(', <a title="Hey, there! This is a tooltip." href="#">Hover for a tooltip</a>');
});</pre>
</div>
<h2 id="options">Options</h2>
<dl class="options">
<dt><strong>content</strong> <i>String, DOM element, Function, jQuery</i></dt>
<dd><div class="possible-values">Possible Values: <span>'[title]', 'string', element, function(updateCallback){...}, jQuery</span></div>Content to display.</dd>
<dt><strong>className</strong> <i>String</i></dt>
<dd>Class for the tips.</dd>
<dt><strong>idName</strong> <i>String</i></dt>
<dd>ID for the tip.</dd>
<dt><strong>bgImageFrameSize</strong> <i>Number</i></dt>
<dd>Size in pixels for the background-image (if set in CSS) frame around the inner content of the tip.</dd>
<dt><strong>showTimeout</strong> <i>Number</i></dt>
<dd>Timeout before showing the tip (in milliseconds 1000 == 1 second).</dd>
<dt><strong>hideTimeout</strong> <i>Number</i></dt>
<dd>Timeout before hiding the tip.</dd>
<dt><strong>timeOnScreen</strong> <i>Number</i></dt>
<dd>How long the tip will be displayed before automatically hiding.</dd>
<dt><strong>showOn</strong> <i>String</i></dt>
<dd><div class="possible-values">Possible Values: <span>'hover', 'focus', 'none'</span></div>Handler for showing the tip. Use <code>'none'</code> if you would like to trigger the tooltip just manually (i.e. by calling the <code>'show'</code> and <code>'hide'</code> methods).</dd>
<dt><strong>liveEvents</strong> <i>Boolean</i></dt>
<dd>Use live events.<br /><br />Note that the API methods (except 'destroy') won't work reliably when live events are used. They will only work for the elements for which the tooltip has been initialized (i.e. shown at least once). Live events are supported in jQuery 1.4.2+.</dd>
<dt><strong>alignTo</strong> <i>String</i></dt>
<dd><div class="possible-values">Possible Values: <span>'cursor', 'target'</span></div>Align/position the tip relative to</dd>
<dt><strong>alignX</strong> <i>String</i></dt>
<dd><div class="possible-values">Possible Values: <span>'right', 'center', 'left', 'inner-left', 'inner-right'</span></div>Horizontal alignment for the tip relative to the mouse cursor or the target element - values 'inner-*' matter if <code>alignTo:'target'</code></dd>
<dt><strong>alignY</strong> <i>String</i></dt>
<dd><div class="possible-values">Possible Values: <span>'bottom', 'center', 'top', 'inner-bottom', 'inner-top'</span></div>Vertical alignment for the tip relative to the mouse cursor or the target element - values 'inner-*' matter if <code>alignTo:'target'</code></dd>
<dt><strong>offsetX</strong> <i>Number</i></dt>
<dd>Offset X pixels from the default position - doesn't matter if <code>alignX:'center'</code></dd>
<dt><strong>offsetY</strong> <i>Number</i></dt>
<dd>Offset Y pixels from the default position - doesn't matter if <code>alignY:'center'</code></dd>
<dt><strong>keepInViewport</strong> <i>Boolean</i></dt>
<dd>Reposition the tooltip if needed to make sure it always appears inside the viewport.</dd>
<dt><strong>allowTipHover</strong> <i>Boolean</i></dt>
<dd>Allow hovering the tip without hiding it onmouseout of the target - matters only if <code>showOn:'hover'</code></dd>
<dt><strong>followCursor</strong> <i>Boolean</i></dt>
<dd>If the tip should follow the cursor - matters only if <code>showOn:'hover'</code> and <code>alignTo:'cursor'</code></dd>
<dt><strong>fade</strong> <i>Boolean</i></dt>
<dd>Use fade animation.</dd>
<dt><strong>slide</strong> <i>Boolean</i></dt>
<dd>Use slide animation.</dd>
<dt><strong>slideOffset</strong> <i>Number</i></dt>
<dd>Slide animation offset.</dd>
<dt><strong>showAniDuration</strong> <i>Number</i></dt>
<dd>Show animation duration.</dd>
<dt><strong>hideAniDuration</strong> <i>Number</i></dt>
<dd>Hide animation duration.</dd>
<dt><strong>refreshAniDuration</strong> <i>Number</i></dt>
<dd>Animation duration when updating the tooltip asynchronously.</dd>
</dl>
<h2 id="methods">Methods</h2>
<dl class="options">
<dt><strong>.poshytip('show')</strong></dt>
<dd>Manually show the tooltip. Make sure the <code>alignTo</code> option is set to <code>'target'</code> in order the tooltip to be properly positioned when you trigger it.</dd>
<dt><strong>.poshytip('showDelayed', [ timeout ] )</strong></dt>
<dd>Manually show the tooltip with a delay. Make sure the <code>alignTo</code> option is set to <code>'target'</code> in order the tooltip to be properly positioned when you trigger it.<div class="signature"><strong>timeout</strong> (optional) number - Custom timeout in milliseconds. If not passed, the <code>showTimeout</code> option value is used by default.</div></dd>
<dt><strong>.poshytip('hide')</strong></dt>
<dd>Manually hide the tooltip.</dd>
<dt><strong>.poshytip('hideDelayed', [ timeout ] )</strong></dt>
<dd>Manually hide the tooltip with a delay.<div class="signature"><strong>timeout</strong> (optional) number - Custom timeout in milliseconds. If not passed, the <code>hideTimeout</code> option value is used by default.</div></dd>
<dt><strong>$.Poshytip.hideAll()</strong></dt>
<dd>Hide all the tooltips on the page.</dd>
<dt><strong>.poshytip('update', content, [ dontOverwriteOption ] )</strong></dt>
<dd>Update the tooltip content at any time.<div class="signature"><strong>content</strong> '[title]', 'string', element, function(updateCallback){...}, jQuery<br /><strong>dontOverwriteOption</strong> (optional) A boolean flag - if set to <code>true</code> the content will be updated just temporary while the tooltip is active. The next time it is shown again, the default content will be used.</div>Examples:<br /> - Update content permanently (works even when the tooltip is not active):<div class="signature">.poshytip('update', 'New permanent content')</div> - Update content temporary while the tooltip is active:<div class="signature">.poshytip('update', 'Temporary content', true)</div></dd>
<dt><strong>.poshytip('disable')</strong></dt>
<dd>Disable the tooltip.</dd>
<dt><strong>.poshytip('enable')</strong></dt>
<dd>Enable the tooltip.</dd>
<dt><strong>.poshytip('destroy')</strong></dt>
<dd>Destroy completely the tooltip functionality.</dd>
</dl>
<h2 id="notes">Notes</h2>
<ul>
<li>Requires jQuery 1.4+</li>
<li>Works in IE6+, FF 2+, Opera 9+, Safari 3+, Chrome</li>
<li>In IE6 min/max-width are supported (only px values) for the tooltip container DIV so you can use them in your CSS without worrying for IE6 (if you still care about it)</li>
<li>When a background-image is set for the tooltip container DIV, the script will neglect the background-color/padding/border declarations set for it and will use the background image to create a scalable frame around the tooltip inner DIV (for an explanation how this works, please take a look at the <a href="http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/">Poshy Tip Page</a>)</li>
<li>In IE6 PNG background images are not supported (only GIF). If a PNG is set as a background-image for the tooltip container, in IE6 the script will fallback and use the background-color/padding/border declarations instead.</li>
</ul>
<h2 id="license">License</h2>
<p>Like jQuery, Poshy Tip is dual licensed under the <a href="http://github.com/vadikom/poshytip/raw/master/MIT-LICENSE.txt">MIT</a> and <a href="http://github.com/vadikom/poshytip/raw/master/GPL-LICENSE.txt">GPL</a> licenses.</p>
<h2 id="download">Download</h2>
<p>Download link: <a href="http://vadikom.com/files/?file=poshytip/poshytip-1.2.zip">http://vadikom.com/files/?file=poshytip/poshytip-1.2.zip</a></p>
<h3>Git</h3>
<p>The Poshy Tip source code is also available at GitHub:</p>
<div class="code-block">
<pre class="sh_html">git clone git://github.com/vadikom/poshytip.git</pre>
</div>
<h2 id="support">Support</h2>
<p>Post your questions/suggestions in the <a href="http://www.smartmenus.org/forum/">support forums</a>.</p>
<h2 id="donate">Donate</h2>
<p>If you appreciate this script, you can support me by <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal@vadikom.com&no_shipping=1&currency_code=USD&item_name=Poshy+Tip+jQuery+Plugin+Development" rel="nofollow">donating a small amount</a> through PayPal or just by <a href="http://www.addtoany.com/share_save?linkname=Poshy%20Tip%20-%20Tooltip%20Plugin%20for%20jQuery%20-%20Vadikom&linkurl=http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/" rel="nofollow">spreading the word</a> about it. Your support is highly appreciated!</p>
</div>
</div>
</body>
</html>