-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslide.html
247 lines (201 loc) · 6.33 KB
/
slide.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
<html>
<head>
<title>slide.show()</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<style type="text/css">
/* system styles */
textarea {
width:100%;
height:80%;
}
.dialog {
display:none;
}
#menu {
position:absolute;
right:1em;
margin:0;
display:inline;
list-style:none;
}
#menu li {
display:inline;
width:auto;
}
#menu a {
color:inherit;
}
/* styles shows state of slides and dialogs */
.slide, .active, .disable, .enable {
}
/* slideshow layout styles */
body {
font-family: corbel,'lucida grande',helvetica,sans-serif;
font-size:20px;
line-height:1.5;
background-color:grey;
}
#head {
background-color:black;
color:white;
}
#foot {
background-color:black;
color:white;
font-size:0.6em;
position:absolute;
bottom:0.5em;
width:98%;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function() {
// activate first slide and hide the following on start
jQuery('.slide').hide();
jQuery('.slide:first').addClass('active').fadeIn();
// show previous slide when user clicks on #head
jQuery('#prev').click(function() {
// if slideshow starts
if (jQuery('.active').length == 0) {
jQuery('.slide:last').addClass('active').fadeIn('fast');
}
// if first slide reached
else if (jQuery('.slide:first').hasClass('active')) {
jQuery('.active').fadeOut('fast', function() {
jQuery('.active').removeClass('active');
jQuery('.slide:last').addClass('active').fadeIn('fast');
});
}
// before first slide
else {
jQuery('.active').fadeOut('fast', function() {
jQuery('.active').removeClass('active').prev().addClass('active').fadeIn('fast');
});
}
});
// show next slide when user clicks on #head
jQuery('#next').click(function() {
// if slideshow starts
if (jQuery('.active').length == 0) {
jQuery('.slide:first').addClass('active').fadeIn('fast');
}
// if last slide reached
else if (jQuery('.slide:last').hasClass('active')) {
jQuery('.active').fadeOut('fast', function() {
jQuery('.active').removeClass('active');
jQuery('.slide:first').addClass('active').fadeIn('fast');
});
}
// before last slide
else {
jQuery('.active').fadeOut('fast', function() {
jQuery('.active').removeClass('active').next().addClass('active').fadeIn('fast');
});
}
});
// add empty slide
jQuery('#add').click(function() {
jQuery('.active').fadeOut('fast').removeClass('active').after('<div class="slide"></div>').addClass('active').fadeIn('fast');
});
// dialog - edit - show
jQuery('#edit').click(function() {
jQuery('#slide-code').val(jQuery('.active').html().trim());
jQuery('.active').addClass('disable').fadeOut('fast');
jQuery('#dialog-edit').addClass('enable').fadeIn('fast');
});
// dialog - edit - submit button
jQuery('#dialog-edit form').submit(function() {
jQuery('#dialog-edit').removeClass('enable').fadeOut('fast');
jQuery('.active').html(jQuery('#slide-code').val()).fadeIn('fast');
});
// dialog - edit - cancel button
jQuery('#dialog-edit input[type="reset"]').click(function() {
jQuery('#dialog-edit').removeClass('enable').fadeOut('fast');
jQuery('.active').fadeIn('fast');
});
// button - remove
jQuery('#remove').click(function() {
if (jQuery('.slide:last').hasClass('active')) {
jQuery('.active').fadeOut('fast').remove();
jQuery('.slide:last').addClass('active').fadeIn('fast');
}
else {
jQuery('.active').fadeOut('fast').next().addClass('active').fadeIn('fast').prev().remove();
}
});
});
</script>
</head>
<body>
<div id="head">
slide.show()
<ul id="menu">
<li><a id="prev" href="#">previous</a></li>
<li><a id="next" href="#">next</a></li>
<li><a id="add" href="#">add</a></li>
<li><a id="edit" href="#">edit</a></li>
<li><a id="remove" href="#">remove</a></li>
</ul>
</div>
<!-- edit dialog for slides -->
<div class="dialog" id="dialog-edit">
<form action="#">
<textarea id="slide-code"></textarea><br/>
<input type="submit"/>
<input type="reset"/>
</form>
</div>
<!-- first example slide --->
<div class="slide">
<h1><pre>slide.show()</pre></h1>
<h2>Getting started</h2>
</div>
<!-- second example slide --->
<div class="slide">
<h3>FAQ</h3>
<ul>
<li>
What's the goal of slide.show()?
<ul><li>Platform independent slideshows.</li></ul>
</li>
<li>
PDFs provides platform independent slideshows for years. What's the advantage?
<ul><li>Due to technical reasons PDFs doesn't offer animations. Thanks to JavaScript HTML does.</li></ul>
</li>
<li>
<ll>
Which know how is required?
<ul><li>slide.show() uses XHTML, CSS, JavaScript and jQuery.</li></ul>
</li>
</ul>
</div>
<!-- third example slide -->
<div class="slide">
<h3>Slide structure</h3>
<pre>
<!-- Slides are within a div with class "slide" -->
<strong><div class="slide"></strong>
<!-- HTML Tags can be used in slides. For example for bullet points -->
<strong><ul>
<li>One bullet points</li>
</ul>
</div></strong>
</pre>
</div>
<!-- fourth example slide -->
<div class="slide">
<h3></h3>
<p>Insert images (<img/>) and <a href="http://code.google.com/intl/de-DE/apis/chart/docs/user_submitted_gallery.html" target="_blank">hyperlinks</a> (<a/>) as used.</p>
<img src="http://chart.apis.google.com/chart?chco=CA3D05,87CEEB&chd=e:AAB4DhEzFxGnHrJRLhOZRmUpXCYZYpYAXCWfXCZIczhmmtrKuE,..-H8e7M6O5Y4U2u0exmuZrWo9nmnWn.o9pgo9m3jMeZZSU1R7&chdl=My+Website.com|Competition.com&chf=bg,s,1F1D1D|c,lg,0,363433,1.0,2E2B2A,0.0&chg=25.0,25.0,3,2&chls=3|3&chm=r,FF00004C,0,0.40,0.60|R,0080004C,0,0.70,0.90|d,CA3D05,0,-1,12,0|d,FFFFFF,0,-1,8,0|d,87CEEB,1,-1,12,0|d,FFFFFF,1,-1,8,0&chs=450x300&cht=lc&chts=FFFFFF,14&chtt=Web+Traffic|(In+billions+of+hits)&chxl=0:||25|50|75|100|1:|Hits|2:|Nov|Dec|Jan|Feb|Mar|3:|2007|2007|2008|2008|2008|4:|Month&chxp=1,50.0|4,50.0&chxr=1,0.0,100.0&chxs=0,FFFFFF,12,0|1,FFFFFF,12,0|2,FFFFFF,12,0|3,FFFFFF,12,0|4,FFFFFF,14,0&chxt=y,y,x,x,x&chma=55,120,0,0"/>
</div>
<!-- fifth example slide -->
<div class="slide">
<h3>Now it's your turn!</h3>
<p>Create slideshows with HTML. Have fun.</p>
<p style="font-weight:bold">To save your changes press ctrl+s.</p>
</div>
<div id="foot">
slide.show() - Platform independent slideshows in your Browser.
</div>
</body>
</html>