jQuery Mobile: Mini drop down menu

This entry is part 67 of 73 in the series jQuery Mobile

This is a mini drop down menu with a selected option.

The 3rd option is selected in the menu.

This is the so called native drop down menu as building this is the same as building a Javascript drop down menu.

<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.1/jquery.mobile-1.4.1.min.js'></script>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header' data-theme='b'>
        <h1>A Mini Drop Down Menu App</h1>
    </div>

    <div data-role='content'>
        <form>
            <div class='ui-field-contain'>
                <select name='name1' id='id1' data-mini='true'>
                    <option value='1'>The 1st Option</option>
                    <option value='2'>The 2nd Option</option>
                    <option value='3' selected='selected'>The 3rd Option</option>
                    <option value='4'>The 4th Option</option>
                </select>
            </div>
        </form>
    </div>

    <div data-role='footer' data-position='fixed'>
        <h4 style='text-align:center;'>I'm the footer</h4>
    </div>
</div>

</body>
</html>
Try The Code

jQuery Mobile: Mini Size Radio Buttons

This entry is part 23 of 73 in the series jQuery Mobile

For a more compact mini size radio button, add the¬†data-mini=’true’¬†attribute to the element to create a mini version.

<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header'><h1>Mini Size Radio Buttons</h1></div>
    <br>

    <p>Mini Size Radio Buttons</p>

    <form>
        <fieldset data-role='controlgroup' data-mini='true'>
            <input type='radio' name='radio_choice' id='radio_choice_id1' value='on' checked='checked'>
            <label for='radio_choice_id1'>One</label>
            <input type='radio' name='radio_choice' id='radio_choice_id2' value='off'>
            <label for='radio_choice_id2'>Two</label>
            <input type='radio' name='radio_choice' id='radio_choice_id3' value='other'>
            <label for='radio_choice_id3'>Three</label>
        </fieldset>
    </form>

    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code