SlideShare a Scribd company logo
jQUERY AWESOMESAUCE
and other awesomeness
   PRESENTED FOR YOUR PLE ASURE
   with commentary by Sean Gaffney
HELLO.
   OH HAI!

             My name is Sean.
             I’m o en unsure of what to do
             with my hair.
             I help designers and rms
             communicate tiny details through
G EEK!       technology on the web. Basically,
             I’m an awesomeloper. Too much?
WHAT’S YOUR jQUERY?
CALLER? CALLER, ARE YOU THERE?

★   jQuery is a JavaScript library
★   JavaScript is not jQuery
★   DOM, DOM, DOM... Elements and Events can
    get pretty hairy in traditional JavaScript, but
    jQuery makes it easy breezy.
HOW E-Z BREE-Z?
LU K E , I ’ M Y O U R FA T H E R .

Traditional JavaScript:
if (document.getElementById) { // DOM3 = IE5, NS6

 document.getElementById('MyID').style.display = 'none';
}
else {

 if (document.layers) { // Netscape 4

 
 document.MyID.display = 'none';

 }

 else { // IE 4

 
 document.all.MyID.style.display = 'none';

 }
}
HOW E-Z BREE-Z?
LU K E , I ’ M Y O U R FA T H E R .

With jQuery:
$('#MyID').hide();


//   Wait, that’s it?
//   Yup.
//   Oh. Wow.
//   I know.
//   He must work out.
BUT WAIT.
THERE’ S MORE.

jQuery has support for lots of goodies:
★   Element selection, traversal and manipulation
★   Event binding
★   Animation effects
★   AJAX
THE SELECTOR
CSS FTW!

jQuery uses CSS-style selectors.
// Pound for IDs
$('#MyID').hide();

// Dot for classes
$('div.myDiv').fadeIn(1000);

// Raw HTML tags
$('h1 a').attr('title','Take me home!');

// Pseudo-selectors, Extended
$('ul li:last').css('border',0);
$('#signupForm :checked').doAwesome();
SELECTOR OPTIMIZATION
I J U S T. . . C A N ’ T. . . D O I T , C A P T A I N .

Selectors can be very fast or very slow...
// IDs are very fast, native to JS
$('#header');

// Although this...
$('#header').find('div.logo');
// is faster than
$('#header div.logo');

// "Specific on the right, light on the left"
$('.geoData td.columbia');
// as opposed to...
$('table.geoData .columbia');
MANIPULATION
Q U I T P L A Y I N G G A M E S W I T H M Y H E A R T.

Let’s interact with some elements.
// Add/remove classes
$('.tab a').addClass('selected').removeClass('unselected');

// Modify CSS properties
$('#header').css('color','#f00');

// Modify HTML
$('.entry p:last').append('<p>The End.</p>');
$('body').html('<h1>Oops.</h1>');

// Create an element
$('<a/>').appendTo('#header');
TRAVERSAL
I ’ L L TA K E S W O R D S F O R $ 2 0 0 , T R E B E K .

Need to move around the DOM? No problemo.
// Move up the DOM until you hit x
$('h1').doSomething().closest('#header').doSomethingElse();

// Grab the parent, then come back and get siblings
$('li').parent().doIt().end().siblings().moreIt();

// Select the 3rd item in the object
$('#theList li').eq(2);
EVENTS
YOU’RE INVITED!

    ere are several (read: many) to choose from.
// These are called "shortcut methods"
.blur(function(){...});
.click(...)
.mouseenter(...)
.hover(...)
.submit(...)
...

// Because they all map to this guy
.bind('click', [data], function([event]){...});

// Of note...
.one('click', [data], function([event]){...});
EFFECTS
R E D L I G H T. G R E E N L I G H T.

Also several (read: many) to choose from.
// Some effects "shortcut methods"
.fadeIn();
.slideUp(...)
...

// And they all map to this guy
.animate(properties, [duration], [easing], [callback]);
jQUERY LESSONS LEARNED
     aka DEMO TIME
          INTERNET SLIDESHOW DWELLER S :
My sincerest apologies that I’m unable share the live demo.
I CAN HAZ?
G E T I T W H I L E I T ’ S H O T.

http://jquery.com
http://rebeccamurphey.com/jqfundamentals
http://jqueryfordesigners.com
http://paulirish.com/2009/perf/
MADE POSSIBLE IN PART BY:
Official Documentation:
http://api.jquery.com


Slide format inspiration:
http://www. ickr.com/photos/jasonsantamaria/
311149672/sizes/o/
jQuery Awesomesauce
YO NUMBA? I CAN HAVE IT?
Please don’t hesitate to provide feedback on this
presentation or ask questions. anks!


http://seangaffney.cc
sean@seangaffney.cc
@seangaffney

More Related Content

KEY
Everything You Need to Know in Order to Start Using jQuery
PDF
jQuery - 10 Time-Savers You (Maybe) Don't Know
PDF
Let jQuery Rock Your World
PDF
บทที่ 3 เริ่มใช้งานโปรแกรม
KEY
Week 4 - jQuery + Ajax
PDF
API Design
TXT
php Slideshare
PPTX
Oh, you’re the NY times guy
Everything You Need to Know in Order to Start Using jQuery
jQuery - 10 Time-Savers You (Maybe) Don't Know
Let jQuery Rock Your World
บทที่ 3 เริ่มใช้งานโปรแกรม
Week 4 - jQuery + Ajax
API Design
php Slideshare
Oh, you’re the NY times guy

What's hot (20)

PDF
bcgr3-jquery
PDF
Javascript session june 2013 (iii) jquery json
PPT
Kick start with j query
PDF
How to work with legacy code
PDF
How to work with legacy code PHPers Rzeszow #2
PDF
Write Less Do More
PDF
An Introduction to Jquery
PDF
How kris-writes-symfony-apps-london
PDF
How Kris Writes Symfony Apps
TXT
Declarations sample
PDF
How Kris Writes Symfony Apps
KEY
An introduction to jQuery
PDF
Information Science Blog Aggregation
PPTX
webstudy jquery
PDF
Migrare da symfony 1 a Symfony2
PDF
Mojolicious
PDF
NodeJS The edge of Reason - Lille fp#6
PDF
PhoneGap: Local Storage
PDF
Practica csv
PDF
jQuery Essentials
bcgr3-jquery
Javascript session june 2013 (iii) jquery json
Kick start with j query
How to work with legacy code
How to work with legacy code PHPers Rzeszow #2
Write Less Do More
An Introduction to Jquery
How kris-writes-symfony-apps-london
How Kris Writes Symfony Apps
Declarations sample
How Kris Writes Symfony Apps
An introduction to jQuery
Information Science Blog Aggregation
webstudy jquery
Migrare da symfony 1 a Symfony2
Mojolicious
NodeJS The edge of Reason - Lille fp#6
PhoneGap: Local Storage
Practica csv
jQuery Essentials
Ad

Viewers also liked (20)

PPTX
Institut jean jacques rousseau
PPTX
Presentación jeanne d'arc
PPT
Institut d'éducation du caraïbe
PPTX
Institut jean jacques rousseau2
PPT
Travailler ensemble en cours
PPT
PPT
PPTX
The Thirteen Colonies
 
PPTX
10 YouTube Listening Speaking Lessons
PPT
PPT
PDF
10 Listeningspeaking Lessons You Tube Handout
PPTX
Tesol 2010 Without Videos
PPT
PDF
10 Listeningspeaking Lessons You Tube Handout
PPT
PPT
PPT
PPT
KEY
Running Start's Young Women's Political Leadership Program
Institut jean jacques rousseau
Presentación jeanne d'arc
Institut d'éducation du caraïbe
Institut jean jacques rousseau2
Travailler ensemble en cours
The Thirteen Colonies
 
10 YouTube Listening Speaking Lessons
10 Listeningspeaking Lessons You Tube Handout
Tesol 2010 Without Videos
10 Listeningspeaking Lessons You Tube Handout
Running Start's Young Women's Political Leadership Program
Ad

Similar to jQuery Awesomesauce (20)

PPTX
Jquery Complete Presentation along with Javascript Basics
PPTX
Getting Started with jQuery
PPTX
Web technologies-course 11.pptx
PDF
Learning jquery-in-30-minutes-1195942580702664-3
PDF
jQuery in 15 minutes
ODP
Jquery- One slide completing all JQuery
PPT
J query presentation
PPT
J query presentation
PPT
J query lecture 1
PDF
Jquery tutorial-beginners
PPTX
jQuery
PDF
Introduction to jQuery
PDF
Introduction to jQuery
PPTX
Getting started with jQuery
PPT
J query
PPTX
Iniciando com jquery
PPTX
jQuery Presentasion
PDF
Jquery in-15-minutes1421
PPTX
presentation_jquery_ppt.pptx
PPT
J query introduction
Jquery Complete Presentation along with Javascript Basics
Getting Started with jQuery
Web technologies-course 11.pptx
Learning jquery-in-30-minutes-1195942580702664-3
jQuery in 15 minutes
Jquery- One slide completing all JQuery
J query presentation
J query presentation
J query lecture 1
Jquery tutorial-beginners
jQuery
Introduction to jQuery
Introduction to jQuery
Getting started with jQuery
J query
Iniciando com jquery
jQuery Presentasion
Jquery in-15-minutes1421
presentation_jquery_ppt.pptx
J query introduction

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PPTX
Cloud computing and distributed systems.
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
MIND Revenue Release Quarter 2 2025 Press Release
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
Cloud computing and distributed systems.
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

jQuery Awesomesauce

  • 1. jQUERY AWESOMESAUCE and other awesomeness PRESENTED FOR YOUR PLE ASURE with commentary by Sean Gaffney
  • 2. HELLO. OH HAI! My name is Sean. I’m o en unsure of what to do with my hair. I help designers and rms communicate tiny details through G EEK! technology on the web. Basically, I’m an awesomeloper. Too much?
  • 3. WHAT’S YOUR jQUERY? CALLER? CALLER, ARE YOU THERE? ★ jQuery is a JavaScript library ★ JavaScript is not jQuery ★ DOM, DOM, DOM... Elements and Events can get pretty hairy in traditional JavaScript, but jQuery makes it easy breezy.
  • 4. HOW E-Z BREE-Z? LU K E , I ’ M Y O U R FA T H E R . Traditional JavaScript: if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('MyID').style.display = 'none'; } else { if (document.layers) { // Netscape 4 document.MyID.display = 'none'; } else { // IE 4 document.all.MyID.style.display = 'none'; } }
  • 5. HOW E-Z BREE-Z? LU K E , I ’ M Y O U R FA T H E R . With jQuery: $('#MyID').hide(); // Wait, that’s it? // Yup. // Oh. Wow. // I know. // He must work out.
  • 6. BUT WAIT. THERE’ S MORE. jQuery has support for lots of goodies: ★ Element selection, traversal and manipulation ★ Event binding ★ Animation effects ★ AJAX
  • 7. THE SELECTOR CSS FTW! jQuery uses CSS-style selectors. // Pound for IDs $('#MyID').hide(); // Dot for classes $('div.myDiv').fadeIn(1000); // Raw HTML tags $('h1 a').attr('title','Take me home!'); // Pseudo-selectors, Extended $('ul li:last').css('border',0); $('#signupForm :checked').doAwesome();
  • 8. SELECTOR OPTIMIZATION I J U S T. . . C A N ’ T. . . D O I T , C A P T A I N . Selectors can be very fast or very slow... // IDs are very fast, native to JS $('#header'); // Although this... $('#header').find('div.logo'); // is faster than $('#header div.logo'); // "Specific on the right, light on the left" $('.geoData td.columbia'); // as opposed to... $('table.geoData .columbia');
  • 9. MANIPULATION Q U I T P L A Y I N G G A M E S W I T H M Y H E A R T. Let’s interact with some elements. // Add/remove classes $('.tab a').addClass('selected').removeClass('unselected'); // Modify CSS properties $('#header').css('color','#f00'); // Modify HTML $('.entry p:last').append('<p>The End.</p>'); $('body').html('<h1>Oops.</h1>'); // Create an element $('<a/>').appendTo('#header');
  • 10. TRAVERSAL I ’ L L TA K E S W O R D S F O R $ 2 0 0 , T R E B E K . Need to move around the DOM? No problemo. // Move up the DOM until you hit x $('h1').doSomething().closest('#header').doSomethingElse(); // Grab the parent, then come back and get siblings $('li').parent().doIt().end().siblings().moreIt(); // Select the 3rd item in the object $('#theList li').eq(2);
  • 11. EVENTS YOU’RE INVITED! ere are several (read: many) to choose from. // These are called "shortcut methods" .blur(function(){...}); .click(...) .mouseenter(...) .hover(...) .submit(...) ... // Because they all map to this guy .bind('click', [data], function([event]){...}); // Of note... .one('click', [data], function([event]){...});
  • 12. EFFECTS R E D L I G H T. G R E E N L I G H T. Also several (read: many) to choose from. // Some effects "shortcut methods" .fadeIn(); .slideUp(...) ... // And they all map to this guy .animate(properties, [duration], [easing], [callback]);
  • 13. jQUERY LESSONS LEARNED aka DEMO TIME INTERNET SLIDESHOW DWELLER S : My sincerest apologies that I’m unable share the live demo.
  • 14. I CAN HAZ? G E T I T W H I L E I T ’ S H O T. http://jquery.com http://rebeccamurphey.com/jqfundamentals http://jqueryfordesigners.com http://paulirish.com/2009/perf/
  • 15. MADE POSSIBLE IN PART BY: Official Documentation: http://api.jquery.com Slide format inspiration: http://www. ickr.com/photos/jasonsantamaria/ 311149672/sizes/o/
  • 17. YO NUMBA? I CAN HAVE IT? Please don’t hesitate to provide feedback on this presentation or ask questions. anks! http://seangaffney.cc sean@seangaffney.cc @seangaffney