-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
executable file
·652 lines (575 loc) · 18.5 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery CSS, Effect, Utilities & Contributing to core</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<meta name="author" content="Asa Baylus">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" />
<link rel="stylesheet" href="css/reveal.min.css" />
<link rel="stylesheet" id="theme" href="css/theme/beige.css" />
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<style type="text/css">
pre { box-shadow: 0 0 !important; }
code { box-shadow: 0 0 6px rgba(0, 0, 0, .3); }
</style>
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<style>
.elgreg-slides img {
max-width: 50%;
}
</style>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<section>
<h1>
<br />Back to the Basics
</h1>
<p>Part 2</p>
</section>
<section>
<h3>last meeting we covered...</h3>
<div>
<ul>
<li>selectors<br />
</li>
<li>manipulation</li>
<li>ajax</li>
</ul>
<div style="text-align: left;">
<br />
</div>
</div>
<h3>Tonight we talk about...</h3>
<div>
<ul>
<li>css</li>
<li>effects</li>
<li>utilities</li>
<li>contributing</li>
</ul>
</div>
</section>
<section>
<h2>Bootstrap Your Site</h2>
<div>with Yeoman we'll quickly setup a new website<br />
<a href="http://yeoman.io"><img src="images/yeoman-logo.png" alt="Yeoman.io" style="border-color: transparent;box-shadow: none;"></a></div><pre>
<code>
$ mkdir mywebsite
$ cd mywebsite
$ yeoman init quickstart
</code>
</pre>
<div class="fragment">now we have<br>
<b>jQuery + Modernizr + HTML5 boiler plate</b><br>
Bootstrap<br>
<br>
</div>
<div class="fragment">:)</div>
</section>
</section>
<section>
<h2>
Where are the demos?<br />
</h2>
<p><a href="demo/app/demo.html" target="_new">here</a></p>
</section>
<section>
<h1>
<br />
</h1>
<h1>CSS</h1>
</section>
<section>
<div>
<a href="http://api.jquery.com/css/">.css()</a>
</div>
<div>
change one property <br>
<small><a href="http://jsbin.com/urevor/1/edit" target="_new">http://jsbin.com/urevor/1/edit</a></small>
</div>
<pre>
<code>
$("#foo").css("border", "3px dotted orange")
</code>
</pre>
<p>change more than one style <br>
<small><a href="http://jsbin.com/urevor/2/edit" target="_new">http://jsbin.com/urevor/2/edit</a></small></p>
<div>
<pre>
<code>
$("#foo").css({
"border" : "3px dotted orange",
"opacity": ".5",
property : value
...
});
</code>
</pre>
</div>
</section>
<section>
<h5>Adding Classes</h5>
<div>
<pre>
<code>
$("div").addClass("foo");
// multiple classes
$("div").addClass("foo bar");
</code>
</pre>
</div>
<h5>Removing Classes</h5>
<div>
<pre>
<code>
$("div").removeClass("foo");
// multiple classes
$("div").removeClass("foo bar");
</code>
</pre>
</div><br>
<small><a href="http://jsbin.com/urevor/5/edit" target="_new">http://jsbin.com/urevor/5/edit</a></small>
</section>
<section>
<p>Use a function to remove a class ...</p><br>
<small><a href="http://jsbin.com/urevor/4/edit" target="_new">http://jsbin.com/urevor/4/edit</a></small>
<pre>
<code>
$("div").removeClass(function() {
return $(this).prev().attr('class');
});
</code>
</pre>
<p>or remove all classes ...</p>
<pre>
<code>
$("div").removeClass();
</code>
</pre><br>
<small><a href="http://jsbin.com/urevor/6/edit" target="_new">http://jsbin.com/urevor/6/edit</a></small>
</section>
<section>
<h1>
<br />
</h1>
<h1>EFFECTS</h1>
</section>
<section>
<h2>
<br />
</h2>
<ul>
<li>Based on duration (not frames)</li>
<li>CSS3 vs JS animation</li>
<li>easing "swing" or "linear"</li>
<li>hide/show</li>
<li>fadein/out</li>
<li>slide up/down</li>
<li>toggle</li>
</ul>
</section>
<section>
<h2>hide/show</h2>
<div>
<a href="http://api.jquery.com/category/effects/basics/">http://api.jquery.com/category/effects/basics/</a>
<br />
</div>
<pre>
<code>
$("div").hide();
// restores el to original value
// ex: display:'inline-block'
$("div").show("fast");
$("div").toggle()
</code>
</pre><br>
<small><a href="http://jsbin.com/urevor/8/edit" target="_new">http://jsbin.com/urevor/8/edit</a></small>
</section>
<section>
<h2>fade</h2>
<div>
<a href="http://api.jquery.com/category/effects/fading/">http://api.jquery.com/category/effects/fading/</a>
<br />
</div>
<pre>
<code>
$("div").fadeIn("slow");
$("div").fadeOut("fast");
$("div").fadeTo(2000, 0.5);
</code>
</pre><br>
<small><a href="http://jsbin.com/urevor/9/edit" target="_new">http://jsbin.com/urevor/9/edit</a></small>
</section>
<section>
<h2>slide</h2>
<div>
<a href="http://api.jquery.com/category/effects/sliding/">http://api.jquery.com/category/effects/sliding/</a>
<br />
</div>
<pre>
<code class="javascript">
$("div").slideUp("slow");
$("div").slideDown("fast");
</code>
</pre>
<p>beware of <a href="http://blog.pengoworks.com/index.cfm/2009/4/21/Fixing-jQuerys-slideDown-effect-ie-Jumpy-Animation">padding pop</a>!</p>
<br>
<small>Greg will talk about this later...</small>
</section>
<section>
<h2>stop();</h2>
<p>prevent animation from <br>
continuously firing, watch... </p>
<p>
<a href="http://goo.gl/JwNiC">jQuery look: Tim Van Damme</a>
</p>
<pre><code class="javascript">
$("div").hover(function(){
$(this).slideDown();
}, function(){
$(this).stop().slideUp();
})
</code></pre>
<br>
<small><a href="http://jsbin.com/urevor/16/edit" target="_new">http://jsbin.com/urevor/16/edit</a></small>
</section>
<section>
<h2>Chaining Animation</h2>
<div>each animation will run until it completes<br />then the next will start</div>
<pre>
<code>
$("div").slideDown().fadeOut();
</code>
</pre><br>
<small><a href="http://jsbin.com/urevor/17/edit" target="_new">http://jsbin.com/urevor/17/edit</a></small>
</section>
<section>
<h2>animate</h2>
<p>
<a href="http://api.jquery.com/animate/">http://api.jquery.com/animate/</a>
<br />
</p>
<p>
<font color="#ff0000">
*</font>All animated properties should be animated to a <br />
<em>single numeric value</em>
</p>
<pre>
<code class="javascript">
$("div").animate({
"left" : "+=100px",
"height" : "-=50px",
"font-size": "60px"
} , 2000);
</code>
</pre><br>
<small><a href="http://jsbin.com/urevor/10/edit" target="_new">http://jsbin.com/urevor/10/edit</a></small>
<p>if position is set to "static" (the default) animating top, bottom, left and right will have no effect.</p>
<p>animate color with the <a href="https://github.com/jquery/jquery-color/">jQuery-color plugin</a> </p><br>
<small><a href="http://jsbin.com/urevor/15/edit" target="_new">http://jsbin.com/urevor/15/edit</a></small>
</section>
<section>
<section><h2>CSS3 with jQuery fallback</h2></section>
<section>
<p><a href="http://api.jquery.com/jQuery.cssHooks/">Test for CSS3</a> support</p>
<pre><code class="javascript">
"webkitTransition" in document.documentElement.style
</code>
</pre>
</section>
<section>
better yet just use Modernizr
<pre><code class="javascript">
if (Modernizr.csstransitions){
// CSS3
$('div').addClass('myTransition');
} else {
// jQuery fallback
$('div').animate( ... );
}
</code></pre><br>
<small><a href="http://jsbin.com/urevor/18/edit" target="_new">http://jsbin.com/urevor/18/edit</a></small>
</section>
<section>
Modernizr + YepNope.js to conditionaly load CSS3 animation with jQuery fallback
<pre><code class="javascript">
Modernizr.load({
test: Modernizr.csstransitions,
yep : 'animate-with-css.js',
nope: 'animate-with-jquery.js',
complete: function(){
// initialize the animation
}
});
</code></pre>
</section>
</section>
<section>
<h2>callbacks vs. deferreds</h2>
<br /><br />
<p>Greg Franko</p>
<p><strong>Github:</strong> gfranko</p>
<p><strong>Twitter:</strong> gregfranko</p>
</section>
<section>
<h2>Callbacks</h2>
<div>You can pass a callback function as a parameter to the jQuery <strong>animate()</strong> method.</div>
<pre>
<code>
$(".example").animate({
opacity: 1.0
}, 4000, function() {
// Animation complete
console.log("One of the example animations completed");
});
</code>
</pre>
</section>
<section>
<h2>Deferreds</h2>
<div>jQuery Deferred Objects are super helpful for writing maintainable code when dealing with async code (ie. ajax, animations, etc), without resorting to callback hell.
<br />
<a href="http://jsbin.com/onirab/4/edit" target="_blank">jsbin example</a>
<pre>
<code>
// Wait method that waits x number of seconds to return
function wait(secs) {
var deferred = new $.Deferred();
setTimeout(function() {
deferred.resolve("Finished!");
}, secs * 1000);
return deferred;
}
// Tells the wait method to wait 3 seconds
wait(3).done(function(msg) {
console.log(msg);
});
</code>
</pre>
</section>
<section>
<h2>Deferreds and Animations</h2>
<div>Deferred/promises fire when a targeted element(s) have completed all animations</div>
<pre>
<code>
$(".example").animate({
opacity: 1.0
}, 4000);
$(".example").promise().done(function() {
// All animations have completed
console.log("All of my the animations are complete");
});
</code>
</pre>
</section>
<section>
<h2>Animation Differences</h2>
<ul>
<li>Callbacks will be called each time a single animation completes.</li>
<li>Deferred/promises fires when all elements have completed the animation</li>
</ul>
<p><a href="http://jsbin.com/ofuhaz/4/edit" target="_blank">jsbin example</a></p>
<p><a href="http://gregfranko.com/jquery.tocify.js/" target="_blank">jQuery plugin example</a></p>
</section>
<section>
<h2>jQuery Utility Functions</h2>
<ul>
<li>$.extend()</li>
<li>$.data()</li>
<li>$.map()</li>
<li>$.grep()</li>
</ul>
</section>
<section>
<h2>$.extend()</h2>
<div>Merges the contents of two or more objects together into the first object.<br />
<a href="http://jsbin.com/adujay/3/edit" target="_blank">jsbin example</a></div>
<pre>
<code>
var greg1 = {
name: "Greg Franko",
occupation: "JavaScript Engineer",
interests: {
"sports": "Golf, Tennis"
}
}
var greg2 = {
name: "Greg Lavallee",
occupation: "Web Developer",
interests: {
"reading": "Nerd books"
}
}
var newPerson = $.extend(true, {}, greg1, greg2);
console.log("New and Improved Greg:", newPerson);
</code>
</pre>
</section>
<section>
<h2>$.data()</h2>
<div>Store and returns arbitrary data associated with the specified element.<br />
<a href="http://jsbin.com/ovumat/5/edit" target="_blank">jsbin example</a></div>
<pre>
<code>
$(".test").data("clicked", 0);
$(".test").bind({
"click": function() {
$(this).data("clicked", $(this).data("clicked") + 1);
},
"hover": function() {
console.log($(this).data("clicked"));
}
});
</code>
</pre>
</section>
<section>
<h2>$.map()</h2>
<div>Allows you to run a function against each item in an array and update each value. Returns a new array.<br />
<a href="http://jsbin.com/owicex/2/edit" target="_blank">jsbin example</a></div>
<pre>
<code>
var numbers = [3, 6, 10], isEven;
isEven = $.map(numbers, function(val, index) {
return val % 2 === 0;
});
// [false, true, true]
console.log("New Array", isEven);
</code>
</pre>
</section>
</section>
<section>
<h2>$.grep()</h2>
<div>Allows you to filter an existing array to only return specific values. Returns a new array.<br />
<a href="http://jsbin.com/owicex/2/edit" target="_blank">jsbin example</a></div>
<pre>
<code>
var numbers = [3, 6, 10], evenNumbers;
evenNumbers = $.grep(numbers, function(val, index) {
return val % 2 === 0;
});
// [6, 10]
console.log("Even Numbers Array", evenNumbers);
</code>
</pre>
</section>
<section class="elgreg-slides">
<h1>Contributing to jQuery</h1>
<h2>How you can help (and get help)</h2>
</section>
<section class="elgreg-slides">
<section class="elgreg-slides">
<h2>Bugs, bugs, bugs</h2>
<p><a href="http://bugs.jquery.com/"><img src="images/bugs.png"></a></p>
<p><a href="http://bugs.jquery.com/">http://bugs.jquery.com/</a></p>
</section>
<section class="elgreg-slides">
<p><a href="http://jsfiddle.net/elgreg/JeJM5/">Is that really a bug?</a> Make sure to check:</p>
<ul>
<li><a href="http://docs.jquery.com/How_to_Report_Bugs">How to report bugs</a></li>
<li><a href="http://lmgtfy.com/?q=jquery+animation+jump#">The Google</a></li>
<li><a href="http://forum.jquery.com/">The jQuery forum</a></li>
<li>Stack Overflow</li>
<li>Existing bugs on bugs.jquery.com</li>
<li>That you're in the right place (jQuery plugins, jQuery UI, etc. are somewhere else)</li>
<li>Your own (ridiculous) code</li>
</ul>
</section>
<section>
<h2>Bug reporting basics</h2>
<ol>
<li>Specify version(s) of jQuery, OS, browser(s)</li>
<li>Reduce the bug to a test case on <a href="http://jsfiddle.net/">jsFiddle</a>, <a href="http://jsbin.com/">jsbin</a>, etc.</li>
<li>Stay up to date on your bug!</li>
</ol>
</section>
</section>
<section class="elgreg-slides">
<h2>IRC is your Friend</h2>
<p><a href="http://webchat.freenode.net/?channels=%23jquery"><img src="images/irc.jpg"></a></p>
<p>Limechat, freenode web, etc.</p>
<p>[insert warning here]</p>
</section>
<section class="elgreg-slides">
<section>
<h2>Straight to the Source</h2>
<p><a href="http://github.com/jquery/jquery"><img src="http://octodex.github.com/images/original.jpg"></a></p>
<p>[<a href="http://github.com/jquery/jquery">http://github.com/jquery/jquery</a>]</p>
</section>
<section class="elgreg-slides">
<h2>Don't just report it. Fix it!</h2>
<ol>
<li><a href="https://github.com/jquery/jquery">Fork it</a></li>
<li>
Clone it:
<pre><code class="bash">> git clone https://github.com/jquerydc/jquery.git</code></pre>
</li>
<li>Get in there:<pre><code class="bash">> cd jquerydc</pre></code></li>
<li>Add the master:
<pre><code class="bash">> git remote add upstream https://github.com/jquery/jquery.git</code></pre></li>
<li>Fetch and merge the master
<pre><code class="bash">> git fetch upstream
> git merge upstream/master</pre></code></li>
<li>Run tests!</li>
</ol>
</section>
<section>
<h2>Write tests for what you fix</h2>
<h3>If you don't, you'll be asked to.</h3>
<p>Check out <a href="http://browserstack.com">browserstack</a> for cross browser testing.</p>
<p><a href="http://swarm.jquery.org/user/jquery">Test swarm is rad</a></p>
</section>
<section class="elgreg-slides">
<h2>Pull!</h2>
<p><a href="https://github.com/jquerydc/jquery"><img src="images/pull.jpg"/></a></p>
<p><img src="images/pull_request.png"></p>
<p>Create a pull request. Include information about the ticket from bugs.jquery.com and update the ticket with a link back.</p>
</section>
</section>
<section class="elgreg-slides">
<h2>Thanks</h2>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>