Book Image

jQuery Mobile Web Development Essentials-Third Edition - Third Edition

By : Raymond Camden, Andy Matthews
Book Image

jQuery Mobile Web Development Essentials-Third Edition - Third Edition

By: Raymond Camden, Andy Matthews

Overview of this book

jQuery Mobile is a HTML5-based touch-optimized web framework. jQuery Mobile can be used to build responsive cross-platform websites and apps for a wide range of smartphones, tablets, and desktop devices. The jQuery Mobile framework can be integrated with other mobile app frameworks such as PhoneGap, IBM Worklight, and more. Introduction to jQuery Mobile explains how to add the framework to your HTML pages to create rich, mobile-optimized web pages with minimal effort. You’ll learn how to use jQuery Mobile’s automatic enhancements and configure the framework for customized, powerful mobile-friendly websites. We then dig into forms, events, and styling. You'll see how jQuery Mobile automatically enhances content, and will find out how to use the JavaScript API to build complex sites. We’ll introduce you to how jQuery Mobile can be themed as well looking into how JavaScript can be used for deep sets of customizations. The examples are ready to run and can be used to help kick-start your own site. Along the way, you will leverage all the concepts you learn to build three sample mobile applications.
Table of Contents (20 chapters)
jQuery Mobile Web Development Essentials Third Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

Using popups


Popups (also known as tooltips) are similar to dialogs, but they are much smaller and not necessarily modeled. They can be useful for providing contextual help or descriptive text.

Let's look at an example:

Listing 7-5: test7.html
<div data-role="page" id="first">

   <div data-role="header">
         <h1>Popup Demo</h1>
   </div>
   
   <div role="main" class="ui-content">
          
         <a href="#firstPopup" data-role="button" 
data-rel="popup">Show Popup</a>

   </div>

   <div data-role="popup" id="firstPopup">
    <p>This is just a test. It has some text in it. 
 It is incredibly awesome.</p>
   </div>

</div>

Inside our main content div is a simple link. In order to let jQuery Mobile know that this links to a popup, the data-rel attribute is specified. Note the ID value points to another div on the page. This div has the role of a popup. When viewed in the browser, jQuery Mobile automatically...