您好,我在移动应用程序中,我正在尝试创建一个水平单选按钮全宽,每个按钮占 33%。
这是我的代码
items.push('<div id="id' + i + '" data-role="fieldcontain"><fieldset data-role="controlgroup" data-type="horizontal" class="row_b">');
items.push('<input type="radio" name="radio'+ i +'-choice-1" id="radio'+ i +'-choice-1" value="choice_1" /><label for="radio'+ i +'-choice-1">test1</label>');
items.push('<input type="radio" name="radio'+ i +'-choice-1" id="radio'+ i +'-choice-2" value="choice_2" /><label for="radio'+ i +'-choice-2">test2</label>');
items.push('<input type="radio" name="radio'+ i +'-choice-1" id="radio'+ i +'-choice-3" value="choice_3"/><label for="radio'+ i +'-choice-3">Clear</label>');
items.push('</fieldset></div>');
html += items.join('');
list.append(html).trigger('create');
我试试这个解决方案 JQueryMobile radio buttons with fieldcontain width issue on desktop但它对我不起作用...
我的html如下
.row_b .ui-btn {
text-align: center;
width: 33%;
}
请多多指教
最佳答案
直到今天晚上我才有时间亲自尝试这个,但我遇到了同样的问题,这个链接可能会解决我们的问题:http://the-jquerymobile-tutorial.org/jquery-mobile-tutorial-CH13.php
关于jquery 移动水平单选按钮等于按钮页面宽度百分比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9853746/