Reputation: 597
I want to put a button right next to a toggle switch, however, the button keeps moving to the second line.
jsFiddle
HTML
<div data-role="fieldcontain">
<label for="switch">Privacy:</label>
<select name="switch" id="switch" data-role="slider">
<option value="0">Private</option>
<option value="1">Public</option>
</select>
<a href="#switchinfo" data-rel="dialog" data-role="button" data-icon="info" data-iconpos="notext">Switch Info</a>
</div>
I tried fixing this problem by putting both in the same fieldcontain. However, this did not fix the issue.
Upvotes: 0
Views: 2778
Reputation: 1072
Another solution, use a grid layout: http://jsfiddle.net/ZdkTG/2/
<div data-role="fieldcontain">
<fieldset class="ui-grid-a">
<div class="ui-block-a">
<label for="switch">Privacy:</label>
<select name="switch" id="switch" data-role="slider">
<option value="0">Private</option>
<option value="1">Public</option>
</select>
</div>
<div class="ui-block-b"> <a href="#switchinfo" data-rel="dialog" data-role="button" data-icon="info" data-iconpos="notext" class="ui-button-left">Switch Info</a>
</div>
</fieldset>
</div>
More: JQuery Mobile - Display An HTML Form Inline
Upvotes: 0