Home > Store

Sams Teach Yourself jQuery Mobile in 24 Hours

Register your product to gain access to bonus material or receive a coupon.

Sams Teach Yourself jQuery Mobile in 24 Hours


  • Sorry, this book is no longer in print.
Not for Sale


  • Copyright 2013
  • Edition: 1st
  • Book
  • ISBN-10: 0-672-33594-8
  • ISBN-13: 978-0-672-33594-5

Quickly start using jQuery Mobile with HTML, CSS, and JavaScript.
jQuery Mobile makes it easy for developers to add "native" mobile functionality to their sites and applications, delivering seamless experiences to customers using diverse mobile devices, all from a single code base. In this book, leading mobile expert Phil Dutson helps readers master the latest version of jQuery Mobile, even if they have no previous experience. In just 24 lessons of one hour or less, Dutson guides readers through every step of creating and customizing a mobile website with jQuery Mobile. Each short, easy lesson builds on all that's come before, teaching jQuery Mobile's newest features in the context of real solution development. Readers learn how to: -Create user interfaces with toolbars, buttons, forms, lists, events, and themes -Build responsive layouts and develop new themes -Detect diverse devices -Encode and embed mobile video -Use mobile device simulators -Build apps with PhoneGap and jQuery Mobile -Incorporate QR and Microsoft Tag Codes -And much more Step-by-step instructions walk developers through common questions, issues, and tasks... Quizzes and Exercises build and test knowledge... "Did You Know?" tips offer insider advice and shortcuts... and "Watch Out!" alerts help readers avoid problems. By the time they're finished, readers will be comfortable going beyond the book to "mobilize" virtually any site.



Download free code files here


Related Article

Using jQuery Mobile with QR Codes

Author's Site

Author suggested site: http://jquerymobilein24.com

Sample Content

Online Sample Chapter

Introduction to the jQuery Mobile Framework

Sample Pages

Download the sample pages (includes Chapter 4 and Index)

Table of Contents

Introduction 1
Key Features of This Book     1
How to Use This Book     2
How This Book Is Organized     2
Conventions Used in This Book.     3
Sample Code for This Book     3

Part I: Beginning jQuery Mobile

Hour 1: Getting to Know jQuery Mobile     7
Why You Should Use jQuery Mobile     7
Supported Devices     9
The Developer’s Arsenal     12
Summary     18
Q&A     18
Workshop     19

Hour 2: Working with HTML, CSS, and JavaScript     21
Building Content with HTML     21
Presenting CSS     27
Functioning with JavaScript     32
Summary     37
Q&A     38
Workshop     38

Hour 3: Using the jQuery Framework     41
Including jQuery in Your Site     42
Summary     58
Q&A     58
Workshop     59

Hour 4: Introduction to the jQuery Mobile Framework     61
Adding jQuery Mobile to Your Site.     61
Using Data Roles     63
Creating a Simple Page     65
Understanding the Mobile Initialization Event     69
Using the pageinit Event Instead of $(document).ready()     70
Summary     75
Q&A     76
Workshop     76

Hour 5: Building Your First Mobile Site     79
Structuring the Page     79
Adding a Header and Footer     82
Formatting Text Content.     84
Attaching an Image     86
Linking to a Second Page     89
Summary     91
Q&A     92
Workshop     92

Part II: Creating the User Interface

Hour 6: Knowing the Capabilities of Mobile Devices     97
Understanding Screen Resolutions and PPI     97
Additional Mobile Features    101
Looking at Mobile Operating Systems     105
Learning About Mobile Graded Browser Support     108
Summary     108
Q&A     109
Workshop     110

Hour 7: Learning About Page Layout     113
Using a Single Page Layout     113
Using a Multiple Page Layout     115
Aligning Content with a Grid     122
Conquering Collapsible Content     127
Summary     130
Q&A     130
Workshop     131

Hour 8: Tuning the Toolbars     133
Adding a Header Toolbar     133
Attaching a Navigation Toolbar     137
Adding a Footer Toolbar     139
Positioning the Toolbars     144
Adding Persistent Navigation     148
Summary     150
Q&A     150
Workshop     150

Hour 9: Designing Buttons     153
Beginning with Buttons     153
Overriding Button Defaults     156
Changing the Button Size     158
Adding Icons to Buttons     162
Summary     167
Q&A     167
Workshop     168

Hour 10: Formulating Your Forms     171
Getting Started with Forms     171
Enhancing Forms with jQuery Mobile     173
Extended Input Elements     181
Submitting Forms     186
Summary     188
Q&A     188
Workshop     188

Hour 11: Learning About Lists     191
Creating Standard and Inset Lists     191
Adding Extras to Lists     194
Using Icons and Thumbnails     196
Searching List Content     202
Using a List Within a Form     204
Summary     206
Q&A     206
Workshop     206

Hour 12: Handling Events     209
Events for Page Initialization     209
Brushing Up on Touch Events     215
Looking at Virtual Mouse Events     221
Adapting to the Orientation Event     223
Summary     225
Q&A     225
Workshop     226

Hour 13: Changing the Default Theme     229
Learning About the Theme Framework     229
Theming Site Components     236
Switching the Swatches     239
Summary     247
Q&A     248
Workshop     248

Part III: Customizing Your Content

Hour 14: Sprucing Up Your Design     253
Understanding Copyrights and Licensing     253
Finding Images     257
Functionality Enhancement with Plug-ins     261
Adding Custom Fonts     265
Summary     271
Q&A     271
Workshop     272

Hour 15: Responsive Site Layout     275
Appreciating Media Queries     275
Adjusting Layouts Based on Screen Size     276
Rotating Site Layout     286
Summary     289
Q&A     289
Workshop     290

Hour 16: Rolling Your Own Theme with ThemeRoller     293
Introduction to ThemeRoller     293
Creating a Theme with ThemeRoller     294
Working with a Custom Theme     302
Summary     305
Q&A     305
Workshop     306

Hour 17: Detecting Mobile Devices     309
Learning the Importance of Mobile Detection     309
Using the .htaccess File     310
Playing Device Detective with PHP     313
Using JavaScript as a Detection Method     316
Non-Detection Solutions     320
Summary     323
Q&A     323
Workshop     324

Part IV: Extending the Mobile Experience

Hour 18: Embedding Video Playback for Mobile     327
Understanding Video Playback     327
Embedding a Video with YouTube     328
Embedding a Video with Vimeo     334
Embedding Your Own Video     336
Exploring Other Video Embedding Services     340
Summary     341
Q&A     341
Workshop     341

Hour 19: Encoding Your Own Video for Mobile     343
Learning the Basics of Video Encoding     343
Comparing Video Codecs and Mobile Devices     349
Encoding Video for Mobile Playback     351
Delivering Video Content     357
Summary      359
Q&A     360
Workshop    360

Hour 20: Creating QR and Tag Codes     363
Delving into QR and Tag Codes     363
Scanning QR Codes     364
Rendering Quick Response Codes     365
Generating Microsoft Tag Codes     375
Summary     379
Q&A     379
Workshop     380

Hour 21: Learning to Minify Everything     381
Compressing Code     381
Using Gzip and Deflate     387
Compressing Images     389
Using mod_pagespeed on Your Apache Server     394
Summary     395
Q&A     395
Workshop     396

Hour 22: Using Mobile Device Emulators     397
Turning to Mobile Device Emulators     397
Finding Emulators for Testing     399
Using Emulators for Testing     411
Summary     415
Q&A     415
Workshop     416

Hour 23: Building an App with PhoneGap and jQuery Mobile     419
Getting Started with PhoneGap     419
Including jQuery Mobile in Your Project     430
Compiling the Application     . 437
Summary     440
Q&A     440
Workshop     440

Hour 24: Including jQuery Mobile with WordPress     443
Introducing the WordPress CMS     443
Installing WordPress     444
Creating a Custom Theme for WordPress     445
Adding jQuery Mobile to Your Theme     447
Summary     461
Q&A     462
Workshop     462

Index     465


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020