jQuery mobile

33
Pascal Naujoks | [email protected] | November 2011

description

Introduction to jQuery MobileSome Examples

Transcript of jQuery mobile

Page 1: jQuery mobile

Pascal Naujoks | [email protected] | November 2011

Page 2: jQuery mobile

Framework for building mobile Websites

Page 3: jQuery mobile

Mission: Compatibility, accessibility and usability

Image taken from the flickr Stream of the filamentgroup:http://www.flickr.com/photos/filamentgroup/sets/72157625318352332/

Full jQuery Mobile Browser Support List: http://jquerymobile.com/gbs/

Page 4: jQuery mobile

Mission: Compatibility, accessibility and usability

High market share Supports media queries Actively tested

Low market share Supports media queries Tested sometimes

Does not support media queries

No jQuery at all Fallback to simple HTML and

CSS

Ressource: http://jquerymobile.com/original-graded-browser-matrix/

Page 5: jQuery mobile

Mission: Compatibility, accessibility and usability

High market share Supports media queries Actively tested

Low market share Supports media queries Tested sometimes

Does not support media queries

No jQuery at all Fallback to simple HTML and

CSS

Ressource: http://jquerymobile.com/original-graded-browser-matrix/

Page 6: jQuery mobile

Incredients

Page 7: jQuery mobile

Incredients

Semantic WAI ARIA Input-types data-roles …

Borders Shadows Round corners Gradients …

… all the magic!

Page 8: jQuery mobile

Page and code structure

Page 9: jQuery mobile

<body>

</body>

Application structure

Page

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc id nibh tellus, vel malesuada sapien. Mauris eget nunc ligula, condimentum mattis velit. Vivamus erat augue, consectetur id malesuada vitae, dignissim ac dui. Ut eu nisi lorem. Donec id lacus mauris. Named sed lacus di ninc…

<body>

</body>

Page 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Page 2

Phasellus at justo augue. Sed sit amet lorem risus. In lacus ipsum…Page 3

Praesent et magna sit amet eros bibendum imperdiet…

RegularjQuery Mobile

Page 10: jQuery mobile

Application structure

Page

Header

Page Title

Content

Page content goes here

Footer

Page Footer

Page 11: jQuery mobile

Application structure

Page 12: jQuery mobile

Say Hello, but be nice and semantic!

Page 13: jQuery mobile

Say Hello, but be nice and semantic!

Some nice comparisons about jQuery Mobile VS. Sencha Touch:• http://tysonlloydcadenhead.com/blog/jquery-mobile-vs-sencha-touch• http://www.the4thdimension.net/2011/07/sencha-touch-vs-jquerymobile.html

Page 14: jQuery mobile

data-role="page"

data-role="header"

data-role="content"

data-role="footer"

data-role="navbar"

data-role="controlgroup"

data-role="button"

data-role="list-divider"

data-role="listview "

data-rock-n-roll

data-transition="pop "

data-position="fixed"

data-rel="dialog"

data-title="Page Title Foo"

data-prefetch="true"

data-url="foo.html"

data-theme="b"

data-fullscreen="true"

data-icon="delete"

Overview (since 04.11.2011) at: http://jquerymobile.com/test/docs/api/data-attributes.html

Page 15: jQuery mobile

data-rock-n-roll: Buttons

Page 16: jQuery mobile

data-rock-n-roll: Listviews

Page 17: jQuery mobile

data-rock-n-roll: Form elements

Page 18: jQuery mobile

data-rock-n-roll: Form elements

NoScript? NoProblem!

Page 19: jQuery mobile

Theming

Page 20: jQuery mobile

Theming with… wait… Swatches?!

Page 21: jQuery mobile

The ThemeRoller strikes back!

Available (since 28.10.2011) at: http://jquerymobile.com/themeroller/

Page 22: jQuery mobile

Presenting www.jqmgallery.com

Firebug > Photshop

Page 23: jQuery mobile

Events

Page 24: jQuery mobile

For the „App-Feeling“: Touch events

Images taken from the „Open Source Gesture Library“ of http://gestureworks.com

tab tabhold

swipe swipeleft swiperight

scrollstart scrollstop

Page 25: jQuery mobile

Responsive design

orientationchange portrait landscape

Great simulators for • iPhone: http://www.testiphone.com/• iPad: http://alexw.me/ipad2/#!safari

… for me how still doesn‘t own one of these

Page 26: jQuery mobile

Loading...

<body>

</body>

Page 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Page 2

Phasellus at justo augue. Sed sit amet lorem risus. In lacus ipsum…

•page

beforechange

•pagec

hange

•pagechangefailed

Page 27: jQuery mobile

Loading...

<body>

</body>

Page 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit...

Page 2

Phasellus at justo augue. Sed sit amet lorem risus. In lacus ipsum…

•pagebeforeload

•pageload

•pageloadfailed

Page 3

Praesent et magna sit amet eros bibendum imperdiet…

Page 28: jQuery mobile

Demo

Page 29: jQuery mobile

Amherst College - https://www.amherst.edu/mobile/ Austin Peay State University - http://m.apsu.edu/ Baylor University - http://m.baylor.edu/ Bellarmine University - http://m.bellarmine.edu/ Butler University - http://www.butler.edu/mobile/ Cal State Monterey Bay - http://m.csumb.edu/ Columbia University - http://m.columbia.edu/ Dallas Theological Seminary - http://mobile.dts.edu/ Delaware Valley College -

http://www.delval.edu/mobile Eastern Washington University - http://m.ewu.edu/ EckerdCollege - http://m.eckerd.edu/ Edison State College - https://www.edison.edu/m/ Fort Lewis College -

http://explore.fortlewis.edu/mobile/ George Fox University - http://m.georgefox.edu/ Hamilton College -

http://www.hamilton.edu/mobile/index.html Hampden-Sydney College - http://m.hsc.edu/ Harding University - http://mobile.harding.edu/ Houghton College - http://m.houghton.edu/ Indiana University - https://m.iu.edu/kme-prd/home Istanbul Bilgi University SIS / Turkey -

https://register.bilgi.edu.tr/m Istanbul Bilgi University BilgiOnline / Turkey -

https://register.bilgi.edu.tr/mdl Kankakee Community College - http://m.kcc.edu/

Not enough? Kennesaw State University - http://m.kcc.edu/ Keuka College - http://m.keuka.edu/ Lawrence Technological University - http://m.ltu.edu/ Lehigh University -

http://www4.lehigh.edu/mobile/default.aspx Lynchburg College - http://m.lynchburg.edu/ Mary Baldwin College - http://www.mbc.edu/m/ Marywood University - http://mobile.marywood.edu/ Mount Olive College - http://m.moc.edu/ Pennsylvania State University World Campus -

http://m.worldcampus.psu.edu/ Pittsburg State University - http://m.pittstate.edu/ Providence College - http://m.providence.edu/ St. Mary's College of Maryland -

http://mobile.smcm.edu/ St. Olaf College - http://m.stolaf.edu/ Stanford University - http://m.stanford.edu/ University of Florida - http://m.ufl.edu/ University of Michigan - http://m.umich.edu/ University of North Texas - http://m.unt.edu/ University of Scranton - http://m.scranton.edu/ University of South Florida - http://m.usf.edu/ University of Southern Mississippi - http://m.usm.edu/ Vanderbilt University - http://m.vanderbilt.edu/ Wayne State University - http://mobile.wayne.edu/ Weber State University - http://m.weber.edu/ West Chester University - http://m.wcupa.edu/ List created by Dave Olsen

(https://twitter.com/#!/dmolsen/status/126680771254681600) on 19.10.2011 then filed at https://github.com/jquery/jquery-mobile/wiki/Sites-built-with-jQuery-Mobile

Page 30: jQuery mobile

It‘s going to be BIG

Page 31: jQuery mobile

Conclusion

Page 32: jQuery mobile

Wrap-Up

Quickly built usable and accessible sites for all kind of mobile devices

Very easy to learn Known jQuery based framework Great and huge community Expandable with plugins and

themes Very lightweight (31KB for jQuery

+ 24KB for jQuery Mobile) compared to other frameworks

No f****ng Appstore or something when you build “Apps” with jQuery Mobile

Use your existing and favorite IDE, Repository, etc. for building sites with jQuery Mobile

Does not use new HTML5 semantic tags (<div data-role=“header“> instead of <header>)

No 100% complete HTML – only fallback without enabled JavaScript

IMHO a bit too addicted to the “Apple-Lock”

Not quite as fast as native Apps Limited capabilities (DOM-Size

etc.) Still beta with some bugs

As always: It depends…

Page 33: jQuery mobile

Pascal Naujoks [email protected]

Usage rights:

http://creativecommons.org/licenses/by-nc-sa/2.5/

Sincerely, your jQuery fanboy…

Comic taken from http://xkcd.com/869/Don‘t fall into this!