我在使用平板电脑上的箭头键(带键盘底座)选择radiobuttons时遇到问题。对于普通按钮,选择有效,但不适用于无线电按钮。
<body>
<div data-role="page" data-theme="a">
<div id="type_selection" data-role="controlgroup" data-type="horizontal">
<input type="radio" id="radio_option1" name="radio" checked="checked" /><label for="radio_option1">Option 1</label>
<input type="radio" id="radio_option2" name="radio" /><label for="radio_option2">Option 2</label>
<input type="radio" id="radio_option3" name="radio" /><label for="radio_option3">Option 3</label>
<input type="radio" id="radio_option4" name="radio" /><label for="radio_option4">Option 4</label>
</div>
</div>
</body>
使用键盘选择常规按钮不是问题:
<button id="btn_dothat" data-inline="true">That</button>
无论如何要解决这个问题,还是jQuery Mobile的限制?
答案 0 :(得分:0)
使用checkboxradio("refresh")
更新单选按钮
不要将div
用于control group
,而是使用fieldset
<fieldset id="type_selection" data-role="controlgroup" data-type="horizontal">
<input type="radio" id="radio_option1" name="radio" checked="checked" />
<label for="radio_option1">Option 1</label>
<input type="radio" id="radio_option2" name="radio" />
<label for="radio_option2">Option 2</label>
<input type="radio" id="radio_option3" name="radio" />
<label for="radio_option3">Option 3</label>
<input type="radio" id="radio_option4" name="radio" />
<label for="radio_option4">Option 4</label>
</fieldset>