Book Image

jQuery Mobile Web Development Essentials

By : Raymond Camden, Andy Matthews
Book Image

jQuery Mobile Web Development Essentials

By: Raymond Camden, Andy Matthews

Overview of this book

<p>jQuery Mobile is a unified, HTML5-based user interface system for all popular mobile device platforms. It is compatible with all major mobile, tablet, e-reader and desktop platforms like iOS, Android, Blackberry, Palm WebOS, Nokia/Symbian, and Windows Phone 7.<br /><br /><i>jQuery Mobile Web Development Essentials</i> will explain how to create mobile-optimized sites with the easiest, most practical HTML/JavaScript framework available and to add the framework to your HTML pages to create rich, mobile-optimized web pages with minimal effort.<br /><br />Throughout the book, you'll learn details that help you become a pro at mobile web development. You begin with simple HTML and quickly enhance it using jQuery Mobile for incredible mobile-optimized sites. Start by learning the building blocks of jQuery Mobile&rsquo;s component-driven design. Dig into forms, events, and styling, then finish by building native mobile applications. You will learn how to build websites and apps for touch devices such as iPhone, iPad, Android, and BlackBerry with the recently developed jQuery Mobile library through sample applications of increasing complexity.</p>
Table of Contents (19 chapters)
jQuery Mobile Web Development Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Working with "mini" fields


In the previous examples, we saw how jQuery Mobile automatically enhanced form fields to make them easier on smaller, touch based devices. In general, jQuery Mobile took your fields and made them nice and fat. While that's desirable most of the time, you may want to put your form fields on a bit of a diet. This is especially true for placing form fields in a header or footer. jQuery Mobile supports an attribute on any form field that creates a smaller version of the field: data-mini="true". The following code snippet is a complete example:

<div data-role="fieldcontain">
<label for="name">Name:</label>
<input type="search" name="name" id="name" value="" />
</div>
<div data-role="fieldcontain">
<label for="name">Name (Slim):</label>
<input type="search" name="name" id="name" value="" data- mini="true" />
</div>

The result is a bit subtle, but you can see the height difference in the second field in the following...