22
Multimedia jQuery Mobile Erik Duval Dept. Computerwetenschappen http://www.cs.kuleuven.ac.be/~erikd/

Mume JQueryMobile Intro

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Mume JQueryMobile Intro

Multimedia

jQuery Mobile

Erik DuvalDept. Computerwetenschappen

http://www.cs.kuleuven.ac.be/~erikd/

Page 3: Mume JQueryMobile Intro

wat denken jullie?

3

Page 4: Mume JQueryMobile Intro

4

built on jQuery & jQuery UI

Page 5: Mume JQueryMobile Intro

4

built on jQuery & jQuery UI

Page 7: Mume JQueryMobile Intro

optimized for touch

6

Page 8: Mume JQueryMobile Intro

mobile events

• tap

• taphold

• swipe 

• swipeleft 

• swiperight

7

• orientationchange

• scrollstart

• scrollstop

Page 9: Mume JQueryMobile Intro

progressive enhancement• ‘graceful degradation’

• A-grade – Full enhanced experience with Ajax-based animated page transitions.

• B-grade – Enhanced experience except without Ajax navigation features.

• C-grade – Basic, non-enhanced HTML experience that is still functional

• Not Officially Supported – May work, but haven’t been thoroughly tested or debugged

8

Page 10: Mume JQueryMobile Intro

9

Page 12: Mume JQueryMobile Intro

<div data-role="page"> <div data-role="header"> <h1>Page Title</h1></div> <div data-role="content"> <p>Page content goes here.</p></div> <div data-role="footer"> <h4>Page Footer</h4> </div></div>

11

Page 13: Mume JQueryMobile Intro

<body>

<div data-role="page" id="home">

  <div data-role="header"><h1>Home</h1></div>

  <div data-role="content"><a href="#about">...</a></div>

</div>

<div data-role="page" id="about"> 

  <div data-role="header"><h1>About This App</h1></div>

  <div data-role="content">...! <a href="#home">Go</a></div>

</div>

</body>

12

Page 14: Mume JQueryMobile Intro

• “auto-ajax” to pre-fetch content pages

• does not include GPS, canvas, local storage, ...

13

Page 15: Mume JQueryMobile Intro

transition effects

• slide

• slideup

• slidedown

• pop

• fade

• flip

14

Page 16: Mume JQueryMobile Intro

http

://jq

uery

.com

/

Page 17: Mume JQueryMobile Intro

jQuery

• find something in HTML

• do something to it

16

Page 18: Mume JQueryMobile Intro

$(“#content”) get element with id content$(“li:first”) get first list item$(“tr:odd”) get odd numbered table rows$(“a[target=_blank]”) get all links who’s target is “_blank”$(“form[id^=step]”) get all forms who’s id starts with “step”

Chaining$(“#myId, .myClass, table”)$(“div”).addClass(“redbox”).fadeOut();$(...).html(function(i){return “<p>hello “ + i + “</p>”;});

17

Page 19: Mume JQueryMobile Intro

methods

• Moving Elements: append(), appendTo(), before(), after(),

• Attributes: css(), attr(), html(), val(), addClass()

• Events: bind(), trigger(), unbind(), live(), click()

• Effects: show(), fadeOut(), toggle(), animate()

• Traversing: find(), is(), prevAll(), next(), hasClass()

• Ajax: get(), getJSON(), post(), ajax(), load()

18

Page 22: Mume JQueryMobile Intro

21

Questions?

http://erikduval.wordpress.com/twitter: @ErikDuval