Subversion-Projekte lars-tiefland.cienc

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
9 lars 1
$(function() {
2
 
3
	$('.tooltip').not('#welcome .tooltip').tooltipster({
4
		offsetY: 2,
5
	});
6
	$('#welcome .tooltip').tooltipster({
7
		offsetY: 2,
8
		theme: 'tooltipster-white'
9
	});
10
	$('#demo-default').tooltipster({
11
		offsetY: 2
12
	});
13
	$('#demo-html').tooltipster({
14
		content: $('<img src="doc/images/spiderman.png" width="50" height="50" /><p style="text-align:left;"><strong>Soufflé chocolate cake powder.</strong> Applicake lollipop oat cake gingerbread.</p>'),
15
		// setting a same value to minWidth and maxWidth will result in a fixed width
16
		minWidth: 300,
17
		maxWidth: 300,
18
		position: 'right'
19
	});
20
	$('#demo-theme').tooltipster({
21
		animation: 'grow',
22
		theme: 'tooltipster-pink'
23
	});
24
	$('#demo-callback').tooltipster({
25
		content: 'Loading...',
26
		updateAnimation: false,
27
		functionBefore: function(origin, continueTooltip) {
28
			continueTooltip();
29
 
30
			if (origin.data('ajax') !== 'cached') {
31
 
32
				$.jGFeed('http://ws.audioscrobbler.com/2.0/user/ce3ge/recenttracks.rss?',
33
					function(feeds){
34
						var content = '';
35
						if(!feeds){
36
							content = 'Woops - there was an error retrieving my last.fm RSS feed';
37
							origin.tooltipster('content', content);
38
						}
39
						else {
40
							content = $('<span>I last listened to: <strong>' + feeds.entries[0].title + '</strong></span>');
41
							origin
42
								.tooltipster('content', content)
43
								.data('ajax', 'cached');
44
						}
45
				}, 10);
46
 
47
				origin.data('ajax', 'cached');
48
			}
49
		},
50
		functionAfter: function(origin) {
51
			alert('The tooltip has closed!');
52
		}
53
	});
54
	$('#demo-events').tooltipster({
55
		trigger: 'click'
56
	});
57
	$(window).keypress(function() {
58
		$('#demo-events').tooltipster('hide');
59
	});
60
	$('#demo-interact').tooltipster({
61
		contentAsHTML: true,
62
		interactive: true
63
	});
64
	$('#demo-touch').tooltipster({
65
		touchDevices: false
66
	});
67
	$('#demo-icon').tooltipster({
68
		iconDesktop: true,
69
		iconTouch: true
70
	});
71
	$('#demo-multiple').tooltipster({
72
		animation: 'swing',
73
		content: 'North',
74
		multiple: true,
75
		position: 'top'
76
	});
77
	$('#demo-multiple').tooltipster({
78
		content: 'East',
79
		multiple: true,
80
		position: 'right',
81
		theme: 'tooltipster-punk'
82
	});
83
	$('#demo-multiple').tooltipster({
84
		animation: 'grow',
85
		content: 'South',
86
		delay: 200,
87
		multiple: true,
88
		position: 'bottom',
89
		theme: 'tooltipster-light'
90
	});
91
	$('#demo-multiple').tooltipster({
92
		animation: 'fall',
93
		content: 'West',
94
		multiple: true,
95
		position: 'left',
96
		theme: 'tooltipster-shadow'
97
	});
98
	$('.tooltipster-light-preview').tooltipster({
99
		theme: 'tooltipster-light'
100
	});
101
	$('.tooltipster-punk-preview').tooltipster({
102
		theme: 'tooltipster-punk'
103
	});
104
	$('.tooltipster-noir-preview').tooltipster({
105
		theme: 'tooltipster-noir'
106
	});
107
	$('.tooltipster-shadow-preview').tooltipster({
108
		theme: 'tooltipster-shadow'
109
	});
110
 
111
	$('header select').change(function() {
112
		var goTo = $(this).val();
113
		var section = $('#'+goTo);
114
		var offset = section.offset().top;
115
		$('html, body').scrollTop(offset);
116
	});
117
 
118
	prettyPrint();
119
 
120
 
121
});