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
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
610
Apple TV Developer Kit
bbroulik
1
530
Building Adaptive iOS & Android Apps
bbroulik
0
450
Responsive Web Development Patterns
bbroulik
1
410
Other Decks in Technology
See All in Technology
事業価値と Engineering 2026年度版
recruitengineers
PRO
45
22k
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
170
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
140
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
120
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
200
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
250
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
460
TypeScript入門 2026
recruitengineers
PRO
3
500
オートロックマンションなのに、各部屋は施錠なし!? 攻撃者が組織内ネットワークで大暴れする理由 / The Front Door Is Locked, but the Rooms Are Wide Open: Why Attackers Move Freely Inside Enterprise Networks
nttcom
1
1.6k
toio・myCobotでフィジカルAIっぽいことを行うための検討(とりあえず調査) / フィジカルAI LT(IoTLTによる開催)
you
PRO
0
300
【CEDEC2026】グラフィックスエンジニアのためのニューラルシェーディング入門
cygames
PRO
0
130
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
Featured
See All Featured
A Soul's Torment
seathinner
6
3.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Scaling GitHub
holman
464
140k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
For a Future-Friendly Web
brad_frost
183
10k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
290
Statistics for Hackers
jakevdp
799
230k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
200
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
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