Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Getting Started with jQuery Mobile
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Brad Broulik
July 18, 2012
Technology
1.6k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Getting Started with jQuery Mobile
Brad Broulik
July 18, 2012
More Decks by Brad Broulik
See All by Brad Broulik
The Strangest Secret for the Perfect Team
bbroulik
0
570
Feature Flags
bbroulik
1
600
Swift Performance Tips for Busy iOS Developers
bbroulik
0
1.8k
Responsive Web Development Training
bbroulik
0
220
Freaky Fast Delivery - Responsive Performance Strategies
bbroulik
1
510
UI Testing iOS and Android Apps
bbroulik
0
600
Apple TV Developer Kit
bbroulik
1
530
Building Adaptive iOS & Android Apps
bbroulik
0
440
Responsive Web Development Patterns
bbroulik
1
410
Other Decks in Technology
See All in Technology
LLM/Agent評価:トップ営業の発言を「正解」にする 〜暗黙的正解による評価を営業資産に変える〜
takkuhiro
1
230
kaonavi Tech Night#1
kaonavi
0
110
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
420
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
250
AIコード生成×サプライチェーン攻撃 — PHPが直面する“二重の信頼問題
shinyasaita
0
230
世界、断片、モデル。そして理解
ardbeg1958
1
130
Type-safe IaC for Dart
coborinai
0
160
CIで使うClaude
iwatatomoya
0
290
オブザーバビリティ、本当に活用できてる? 〜API連携×生成AIで成熟度を自動評価〜
dmmsre
1
3.6k
AIと共生する開発者プラットフォーム:バクラクのモノレポ×マイクロサービス基盤
sakajunquality
2
4k
Network Firewallやっていき!
news_it_enj
0
170
Making sense of Google’s agentic dev tools
glaforge
1
290
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Building Adaptive Systems
keathley
44
3.1k
The Limits of Empathy - UXLibs8
cassininazir
1
510
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
Transcript
Getting started with jQuery Mobile @BradBroulik BradBroulik.blogspot.com Slides: bit.ly/codecamp-jqm
Follow along: bit.ly/codecamp-jqm http://farm6.staticflickr.com/5262/5565984041_8e335f0ec0.jpg
Sent text message Used application Used browser Accessed social networking
site Played games Listened to music 28.7% 33.7% 39.2% 52.1% 54.2% 75.9% Top Mobile Activities Mobile Content Usage (U.S.) 3 Month Avg. Ending Nov. 2012 vs. 3 Month Avg. Ending Aug. 2012 Source: comScore MobiLens
Facebook’s top mobile client is mobile web http://www.mobify.com/blog/mobile-stats-57-of-mobile-posting-on-facebook-from-mobile-web/
Twitter’s top mobile client is also mobile web Twitter via
http://www.lukew.com/ff/entry.asp?1413
“A UI framework for building cross-platform Mobile Web applications” “With
a single jQuery Mobile codebase we can create a unified user experience for nearly all mobile devices” jQ uery M obile 1.3
Simplify the journey http://i132.photobucket.com/albums/q24/BluSky07/MOBILE%20GAMES%202/OregonTrailv321.png
One codebase... CSS3
no device customer left behind iOS Android Blackberry Windows WebOS
Meego Kindle Nook Desktop Bada
Simplified Markup-Driven Development <div data-role="page"> <div data-role="header"> <h1>Page Header</h1> </div>
<div data-role="content"> <p>Hello jQuery Mobile!</p> </div> <div data-role="footer"> <h4>Page Footer</h4> </div> </div>
Unified User Interface
A-Grade experience C-Grade experience Progressive Enhancement
Responsive Design
Portrait Landscape Responsive Forms
Default Theme Alternate Theme Themable Styling
Accessible
None
http://www.flickr.com/photos/wongdood/3379046643/sizes/z/in/photostream/ Getting Started in 60 seconds
Build a page #1 <h2>Movies</h2> <ul> <li><a href="#">Kung Fu Panda</a></li>
<li><a href="#">Pirates</a></li> <li><a href="#">X-Men<a><li> </ul>
Add jQuery Mobile #2 <head> <title>Step Two - Add jQuery
Mobile</title> <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> CDN repository or download via jquerymobile.com/download
Enhance: data- attributes #3 <div data-role="header"> <h2>Movies</h2> </div> <ul data-role="listview">
<li><a href="#">Kung Fu Panda</a></li> <li><a href="#">Pirates</a></li> <li><a href="#">X-Men></a><li> </ul>
More enhancements... <div data-role="content"> <ul data-role="listview" data-inset="true"> <li data-role="list-divider">Now Playing</li>
<li> <a href="#"> <img src="images/kungfupanda2.jpg" /> <h3>Kung Fu Panda</h3> <p>Rated: PG</p> <p>Runtime: 95 min.</p> </a> </li> </ul> </div>
Add theming and branding <div data-role="header" data-theme="b"> <h1>Movies</h1> </div> <div
data-role="content"> <ul data-role="listview" data-theme="a"> <li data-role="list-divider">Now Playing</li> <li> <a href="#"> <img src="images/kungfupanda2.jpg" /> <h3>Kung Fu Panda</h3> <p>Rated: PG</p> <p>Runtime: 95 min.</p> </a> </li> </ul> </div>
ThemeRoller http://jquerymobile.com/themeroller/
Single vs multi-page template <body> <!-- page #1 --> <div
data-role="page" id="home" data-title="Welcome"> <div data-role="header"> <h1>Multi-Page</h1> </div> <a href="#contact-info" data-role="button">Contact Us</a> </div> <!-- page #2 --> <div data-role="page" id="contact-info" data-title="Contacts"> <div data-role="header"> <h1>Contact Us</h1> </div> <div data-role="content"> Contact information... </div> </div> </body>
Single-page + prefetch <body> <div data-role="header"> <h1>Prefetch</h1> </div> <a href="contact.html"
data-prefetch="true">Contact Us</a> </body>
Ajaxified Navigation
Step 1, tap the button to navigate to another page
Ajaxified Navigation
Step 2, framework loads the next page side-by-side Ajaxified Navigation
Ajaxified Navigation Step 3, framework transitions to next page
Ajaxified Navigation Step 4, transition complete
Transitions <a href="#" data-role="button" data-transition="slide">slide</a>
Popups Usecases: •alerts •dialogs •tooltips •menus •forms •anything... <div data-role="popup"
id="popupWarning"> <div data-role="header" class="ui-corner-top"> <h1>Warning</h1> </div> <div data-role="content" class="ui-corner-bottom"> <p>No internet connection. Please try again later.</p> <a href="#" data-role="button" data-rel="back">OK</a> </div> </div> <a href="#popupWarning" data-rel="popup" data-role="button">Popup</a> $('#popupWarning').popup( "open" ); // Or dynamically open popup
<div data-role="footer" data-position="fixed"> <div data-role="navbar"> <ul> <li><a href="#" id="home" data-icon="home"
class="ui-btn-active">Home</a></li> <li><a href="#" id="movies" data-icon="star">Movies</a></li> <li><a href="#" id="theatres" data-icon="grid">Theatres</a></li> </ul> </div> </div> Tab bars icon name standard icons custom icons
Segmented Control <div class="segmented-control ui-bar-d"> <div data-role="controlgroup" data-type="horizontal"> <a href="#in-theatres"
data-role="button" data-theme="b">In Theatres</a> <a href="#coming-soon" data-role="button" data-theme="d">Coming Soon</a> <a href="#top-rated" data-role="button" data-theme="d">Top Rated</a> </div> </div> <style> .segmented-control { text-align:center;} .segmented-control .ui-controlgroup { margin: 0.2em; } </style>
Keyboard sensitive input types
Radio & Checkbox
Slider & Switch
Grids
Gradients
Themes: defaults & inheritance page theme set to “e”
Events Diagram mobileinit $(document).on("mobileinit", function(){ $.mobile.defaultPageTransition = "slide"; $.mobile.ajaxEnabled =
false; }); pageinit $(document).on("pageinit", "#my-page", function(e) { // Setup event handler for login button $("#loginButton").on("click", function (e) { alert("Login clicked..."); }); });
<input type=button id="changePage" value="Open dynamic page"> <script> $( "#changePage" ).on(
"click", function() { // Create page markup var newPage = $("<div data-role=header><h1>Hi</h1></div>Hello Again!"); // Add page to page container newPage.appendTo( $.mobile.pageContainer ); // Enhance and open new page $.mobile.changePage( newPage ); }); </script> $.mobile API
Panels (sliding drawer) jQ uery M obile 1.3
Responsive tables jQ uery M obile 1.3
Responsive tables jQ uery M obile 1.3
Responsive grids jQ uery M obile 1.3
More new features... jQ uery M obile 1.3 Listview autocomplete
data-clear-btn=”true” New icons
Inspiration jqmgallery.com
http://codiqa.com/
Adobe Shadow http://tv.adobe.com/watch/adobe-technology-sneaks-2012/adobe-shadow/ Simplifies multi-device testing
+ =
http://www.flickr.com/photos/oddne/3838032598/sizes/l/in/photostream/ How can we gain a performance advantage?
Prefer Native jQuery Mobile Widgets Custom message box adds overhead
Native inset list uses 80% less CSS! Compatible across all browsers! Simplifies maintenance!
Remove Unused Themes <head> <meta charset="utf-8"> <title>Custom Theme</title> <meta name="viewport"
content="width=device-width, initial-scale=1"> <link rel=stylesheet href="css/theme/custom-theme.css" /> <link rel=stylesheet href="css/structure/jquery.mobile.structure.css"/> <script type="text/javascript" src="jquery-min.js"></script> <script type="text/javascript" src="jquery.mobile-min.js"></script> </head> jQuery Mobile’s structure file without default theme
Remove Unused Plugins Download Builder •grid •navbar •select •slider •textinput
•transitions •checkboxradio •collapsible •collapsibleset •controlgroup •fieldContain •fixedToolbar http://jquerymobile.com/download-builder/
Cache highly accessed read-only pages <div data-role="page" data-dom-cache="true"> <div data-role="header">
<h1>Popular Page</h1> </div> <div data-role="content"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur hendrerit nisl et tortor tincidunt mattis. </div> </div>
Prefer the CDN-hosted resources <head> <meta charset="utf-8"> <title>CDN Hosted minified
and gzipped jQuery Mobile files</title> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0;"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script> </head> Example: bonus/config/https/https-template.html
Performance Analysis Tools http://developer.yahoo.com/yslow/mobile http://blaze.io/mobile
You have safely arrived at your destination http://i132.photobucket.com/albums/q24/BluSky07/MOBILE%20GAMES%202/OregonTrailv321.png
Resources • @jquerymobile • #jquerymobile
Questions? Can I integrate with Google or Bing Maps? What’s
coming in the 1.4 release? Server-side versus client-side integration? Can I integrate with RESTful Services?
Thank You! @BradBroulik BradBroulik.blogspot.com Slides: bit.ly/codecamp-jqm