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...