Mat Marquis - JQuery Mobile

84
HarvardWWW jQuery Mobile filament group

description

On April 11th, 2012, Mat Marquis gave a presentation to the ABCD WWW group on An Introduction to jQuery Mobile.Learn how to use jQuery Mobile to build dynamic HTML5-based web sitesand apps that work on all popular mobile platforms. We’ll go over thebasics of using the framework and discuss ways we can use it to createcompelling experiences that span smartphone, tablet, and desktopdevices from a single unified codebase.Mat "Wilto" Marquis is a designer-slash-developer working at FilamentGroup in Boston. Mat is a member of the jQuery Mobile team, technicaleditor at A List Apart, and an active member of the open sourcecommunity. He's probably flipping out about something on Twitter as wespeak.

Transcript of Mat Marquis - JQuery Mobile

Page 1: Mat Marquis - JQuery Mobile

HarvardWWW

jQuery Mobile

filament group

Page 2: Mat Marquis - JQuery Mobile

Hello. Mat MarquisFilament Group Inc.

Page 3: Mat Marquis - JQuery Mobile

Engaging experiences, accessible to everyone.

filament group

Page 4: Mat Marquis - JQuery Mobile

Authors

Page 5: Mat Marquis - JQuery Mobile

Open source contributors

Page 6: Mat Marquis - JQuery Mobile

Sponsor & design lead

Page 7: Mat Marquis - JQuery Mobile

jQuery MobileIn a nutshell

Page 8: Mat Marquis - JQuery Mobile
Page 9: Mat Marquis - JQuery Mobile

Mobile UI framework

Page 10: Mat Marquis - JQuery Mobile

UI Elements

Page 11: Mat Marquis - JQuery Mobile

AJAX Nav

Page 12: Mat Marquis - JQuery Mobile

Project GoalsNo browser left behind.

Page 13: Mat Marquis - JQuery Mobile

10+ BillionWeb enabled mobile devices on the internet

Source: ITU, Mark Lipacis, Morgan Stanley Research.

Page 14: Mat Marquis - JQuery Mobile

(They aren’t all iPhones)

4.01

12.3

17.1

18.17

19.95

22.07

OperaiPhone / iPod TouchAndroidNokiaBlackBerryNetfront

July 2011 World Mobile Browsershttp://gs.statcounter.com/#mobile_browser-ww-monthly-201103-201103-bar

Page 15: Mat Marquis - JQuery Mobile

All Platforms1 codebase

Page 16: Mat Marquis - JQuery Mobile

and for everyone

Make it workeverywhere

Page 17: Mat Marquis - JQuery Mobile

iOS Android WebOSBlackberry WP 7/7.5

Meego/MaemoKindle/Nook

Playbook

Symbian

Symbian

Page 18: Mat Marquis - JQuery Mobile

Desktop too

Page 19: Mat Marquis - JQuery Mobile

50+ devices in our lab

Page 20: Mat Marquis - JQuery Mobile

Built on standards

Page 21: Mat Marquis - JQuery Mobile

Progressive Enhancement

Page 22: Mat Marquis - JQuery Mobile

Don’t break the web.

Bookmark / Refresh Friendly URLS

History Works

Page 23: Mat Marquis - JQuery Mobile

Don’t break the web.

PushState jquerymobile.com/test/docs/api/globalconfig.html

Page 24: Mat Marquis - JQuery Mobile

Keep it accessible

Page 25: Mat Marquis - JQuery Mobile

Touch, mouse, keyboard

Touch & Mouse Events

Mouse Events

Page 26: Mat Marquis - JQuery Mobile

Web to Native

Page 27: Mat Marquis - JQuery Mobile

To App Stores

Page 28: Mat Marquis - JQuery Mobile

Themable, Brandablehttp://jquerymobile.com/themeroller/

Page 29: Mat Marquis - JQuery Mobile
Page 30: Mat Marquis - JQuery Mobile
Page 31: Mat Marquis - JQuery Mobile
Page 33: Mat Marquis - JQuery Mobile

Getting started with

jQuery Mobile

Page 34: Mat Marquis - JQuery Mobile

Step 1.

Make a regular website

Page 35: Mat Marquis - JQuery Mobile

<!DOCTYPE html><html> <head> <title>Welcome!</title> </head> <body> <h1>Welcome!</h1> <p><a href="contact.html">Send me a note!</a></p> </body></html>

Page 36: Mat Marquis - JQuery Mobile
Page 37: Mat Marquis - JQuery Mobile

Step 2.

Add jQuery Mobile

Page 38: Mat Marquis - JQuery Mobile

<!DOCTYPE html><html><head>

<title>My Web App</title> <style>body { text-align: center; }</style>

<meta name="viewport" content="width=device-width,initial- scale=1">

<link rel="stylesheet" href="jquery.mobile.min.css"> <script src="jquery.min.js"></script> <script src="jquery.mobile.min.js"></script>

</head><body> <h1>Welcome to my Site!</h1> <p><a href="contact.html" data-role="button">Contact</a></p></body></html>

Page 39: Mat Marquis - JQuery Mobile

<!DOCTYPE html><html><head>

<title>My Web App</title> <style>body { text-align: center; }</style>

<meta name="viewport" content="width=device-width,initial- scale=1">

<link rel="stylesheet" href="jquery.mobile.min.css"> <script src="jquery.min.js"></script> <script src="jquery.mobile.min.js"></script>

</head><body> <h1>Welcome to my Site!</h1> <p><a href="contact.html" data-role="button">Contact</a></p></body></html>

Page 40: Mat Marquis - JQuery Mobile
Page 41: Mat Marquis - JQuery Mobile

Markup config

Page 42: Mat Marquis - JQuery Mobile

Links, Ajaxified

<a href="page.html">Link</a>

Page 43: Mat Marquis - JQuery Mobile

Listen, intercept, handle w/ Ajax

products.html<div data-role=”page”>

TAP

Page 44: Mat Marquis - JQuery Mobile

Listen, intercept, handle w/ Ajax

products.html<div data-role=”page”>

TAP

Page 45: Mat Marquis - JQuery Mobile

Transitions

<a href="page.html" data-transition="flip">Link</a>

Page 46: Mat Marquis - JQuery Mobile

Transitions

<a href="page.html" data-transition="flip">Link</a>

Page 47: Mat Marquis - JQuery Mobile

Dialog

<a href="page.html" data-rel="dialog">Link</a>

Page 48: Mat Marquis - JQuery Mobile

Button

<a href="page.html"data-role="button">Button</a>

Page 49: Mat Marquis - JQuery Mobile

Icon

<a href="page.html" data-role="button" data-icon="star"> Button</a>

Page 50: Mat Marquis - JQuery Mobile

Theme swatch

<a href="page.html" data-role="button" data-theme="b"> Button</a>

Page 51: Mat Marquis - JQuery Mobile

Listviews

Page 52: Mat Marquis - JQuery Mobile

<ul> <li>Products</li> <li>Services</li> <li>About us</li> <li>Contact</li> </ul>

A Regular UL

Page 53: Mat Marquis - JQuery Mobile

Basic unordered list

Page 54: Mat Marquis - JQuery Mobile

<ul data-role="listview"> <li>Products</li> <li>Services</li> <li>About us</li> <li>Contact</li> </ul>

Add role

Page 55: Mat Marquis - JQuery Mobile

Read-only listview

Page 56: Mat Marquis - JQuery Mobile

<ul data-role="listview"> <li><a href="products.html">Products</a></li> <li><a href="services.html">Services</a></li> <li><a href="about.html">About us</a></li> <li><a href="contact.html">Contact</a></li> </ul>

Add links

Page 57: Mat Marquis - JQuery Mobile

Linked listview

Page 58: Mat Marquis - JQuery Mobile

<ul data-role="listview" data-filter="true" data-inset="true"> <li><a href="products.html">Products</a></li> <li><a href="services.html">Services</a></li> <li><a href="about.html">About us</a></li> <li><a href="contact.html">Contact</a></li> </ul>

Filter + inset

Page 59: Mat Marquis - JQuery Mobile

List with links

Page 60: Mat Marquis - JQuery Mobile

Etc.

Page 61: Mat Marquis - JQuery Mobile

Forms

Page 62: Mat Marquis - JQuery Mobile

Native

Page 63: Mat Marquis - JQuery Mobile

Auto enhanced

Page 64: Mat Marquis - JQuery Mobile

<label for="search">Search Input:</label>

<input type="search" name="password" id="search" value="" data-role="none" />

Opt out

Page 65: Mat Marquis - JQuery Mobile

<label for="search" class="ui-hidden-accessible">Search Input:</label>

<input type="search" name="password" id="search" value="" data-role="none" />

Hide accessibly

Page 66: Mat Marquis - JQuery Mobile

Page regions

Page 67: Mat Marquis - JQuery Mobile

Anatomy of a page

header

footer

content

Page 68: Mat Marquis - JQuery Mobile

<body>

<div data-role="page">

<div data-role="header">...</div>

<div data-role="content">...</div>

<div data-role="footer">...</div>

</div><!-- /page -->

</body>

Page sections

Page 69: Mat Marquis - JQuery Mobile

Metric ton of

Resources

Page 70: Mat Marquis - JQuery Mobile

Adobe CS 5.5

Page 71: Mat Marquis - JQuery Mobile

Tools

Page 72: Mat Marquis - JQuery Mobile

Tools

Page 73: Mat Marquis - JQuery Mobile

Tools

Page 74: Mat Marquis - JQuery Mobile

Tools

http://codiqa.com/jqueryuk

Page 75: Mat Marquis - JQuery Mobile

Tools

Page 76: Mat Marquis - JQuery Mobile

Books

Page 77: Mat Marquis - JQuery Mobile

Putting it all together

Page 78: Mat Marquis - JQuery Mobile

FlipPics

Page 79: Mat Marquis - JQuery Mobile
Page 80: Mat Marquis - JQuery Mobile

Creating Themes

Page 81: Mat Marquis - JQuery Mobile

Basic TR demo movie

Page 82: Mat Marquis - JQuery Mobile

Awesome sponsors

filament group

Page 83: Mat Marquis - JQuery Mobile

filamentgroup.com

@jquerymobile

@filamentgroup

jquerymobile.com

github.com/jquery/jquery-mobile

github.com/filamentgroup

Page 84: Mat Marquis - JQuery Mobile

Thanks!