O'Reilly logo

jQuery Mobile Web Development Essentials Second Edition by Andy Matthews, Raymond Camden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with the mini fields

In the previous examples, we saw how jQuery Mobile automatically enhances form fields to make them easier to use 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required