jquery rescue adventure · 32 | sharepoint saturday columbus 2011 jquery scottgu: jquery and...

34
jQuery Rescue Adventure

Upload: others

Post on 06-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

jQuery Rescue Adventure

Page 2: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

2 | SharePoint Saturday Columbus 2011

Name

Location

Work

Blog

Twitter

Page 3: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

3 | SharePoint Saturday Columbus 2011

Page 4: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

4 | SharePoint Saturday Columbus 2011

jQuery is a new kind of JavaScript Library.

Page 5: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

5 | SharePoint Saturday Columbus 2011

Page 6: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

6 | SharePoint Saturday Columbus 2011

Page 7: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

7 | SharePoint Saturday Columbus 2011

Page 8: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

8 | SharePoint Saturday Columbus 2011

Page 9: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

9 | SharePoint Saturday Columbus 2011

▪ http://jquery.com/

Page 10: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

10 | SharePoint Saturday Columbus 2011

Page 11: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

11 | SharePoint Saturday Columbus 2011

Page 12: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

12 | SharePoint Saturday Columbus 2011

Page 13: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

13 | SharePoint Saturday Columbus 2011

Page 14: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

14 | SharePoint Saturday Columbus 2011

Page 15: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

15 | SharePoint Saturday Columbus 2011

Page 16: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

16 | SharePoint Saturday Columbus 2011

http://api.jquery.com/browser/

Page 17: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

17 | SharePoint Saturday Columbus 2011

Page 18: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

18 | SharePoint Saturday Columbus 2011

Description Selector

Equals Or Starts With Followed by Hyphen [name|=“value”]

Contains Text [name*=“value”]

Contains Word Delimited by Spaces [name~=“value”]

Ends With [name$=“value”]

Starts With [name^=“value”]

Equals [name=“value”]

Not Equals [name!=“value”]

Has Attribute [name]

Multiple Attributes [name=“value”][name2=“value2”]

Page 19: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

19 | SharePoint Saturday Columbus 2011

Description Selector

Currently Animating :animated

Element at Given Index :eq()

Even or Odd Elements in Results :even, :odd

First or Last Element in Result :first, :last

Currently Focused :focus

Greater Or Less than Given Index :gt(), :lt()

Header Elements :header

Elements That Do Not Match :not()

First or Last Child :first-child, :last-child

Child at Given Index :nth-child()

Only Children :only-child

Page 20: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

20 | SharePoint Saturday Columbus 2011

Description Selector

Contains Content (case-sensitive) :contains()

Empty Element :empty

Has An Element :has()

Parent Elements :parent

Page 21: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

21 | SharePoint Saturday Columbus 2011

Page 22: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

22 | SharePoint Saturday Columbus 2011

Description Method

Adding, Removing, Toggling CSS Classes addClass(), removeClass(), toggleClass()

Adding Content .after(), .insertAfter(), .before(), .insertBefore(), .append(), .appendTo(), .prepend(), .prependTo()

Reading and Setting Attributes .attr(“name”), .attr(“name”, “value”),.attr({“name1”: “value1”, “name2”: “value2”})

Reading and Setting CSS Styles .css(“name”), .css(“name”, “value”), .css({“name1”: “value1”, “name2”: “value2”})

Reading and Setting Form Values .val(), .val(“newvalue”)

Reading and Setting Text .text(), .text(“newvalue”)

Reading and Setting HTML .html(), .html(“<strong>newvalue</strong>”)

Wrapping Elements .wrap(), .wrapAll(), .wrapInner()

Removing Elements .remove(), .empty(), .detach(), .unwrap()

Page 23: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

23 | SharePoint Saturday Columbus 2011

Page 24: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

24 | SharePoint Saturday Columbus 2011

Description Method

Loop through all items .each()

Add Elements to Current Results .add()

Filter Results .filter()

Filter Descendants .find()

Map to a New Result .map()

Children Selector .children()

Parent Selectors .parent(), .offsetParent(), .parentsUntil()

Sibling Selectors .siblings(), .next(), .prev(), .nextUntil(), .prevUntil()

Page 25: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

25 | SharePoint Saturday Columbus 2011

Page 26: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

26 | SharePoint Saturday Columbus 2011

Description Method

Generic Bind .bind(“method”, function() { })

Bind Event Once .one(“method”, function() { })

Bind Shortcuts .click(), .change(), .select(), .mouseover(), .mouseout(), .blur()

Hover (Mouseover and Mouseout) .hover(function() { }, function() { })

Trigger Event .trigger(“method”)

Page 27: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

27 | SharePoint Saturday Columbus 2011

Page 28: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

28 | SharePoint Saturday Columbus 2011

Browser Description

Firefox FirebugConsole WindowHTML, CSS, JavaScript

Internet Explorer Developer ToolbarConsole WindowHTML, CSS, JavaScript

Page 29: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

29 | SharePoint Saturday Columbus 2011

Page 30: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

30 | SharePoint Saturday Columbus 2011

Page 31: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

31 | SharePoint Saturday Columbus 2011

Page 33: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

33 | SharePoint Saturday Columbus 2011

Page 34: jQuery Rescue Adventure · 32 | SharePoint Saturday Columbus 2011 jQuery ScottGu: jQuery and Microsoft Jon Galloway: Using CDN Hosted jQuery with a Local Fall-back Copy Find External

Thanks to Our Sponsors!