好吧,也许之前已经回答了,但我无法通过搜索找到任何东西…… 我是jQuery Mobile的新手,我正在尝试动态地将放射线框添加到一个 fieldset容器通过页面,你可以在这个小提琴中看到:http:/
我是jQuery Mobile的新手,我正在尝试动态地将放射线框添加到一个< fieldset>容器通过页面,你可以在这个小提琴中看到:http://jsfiddle.net/4V3Tm/4/
它正在发挥作用.但由于某种原因,我不知道,动态添加的选择并没有像普通的放射线一样被设计.我错过了什么吗?顺便说一下,它们不应该都扩展到页面宽度吗? (好吧,我还是诺布……)
先感谢您.
检查这个小提琴 http://jsfiddle.net/YUvG9/或检查你的更新 http://jsfiddle.net/4V3Tm/4/也许问题是你多次打电话.trigger(‘创造’)$(document).on('pageinit', '#home', function () {
var current = 3;
$('#home input[type=button]').click(function () {
current++;
$('#choices .ui-controlgroup-controls')
.append(
$('<input/>', {
'type': 'radio',
'name': 'choice',
'id': 'choice' + current,
'value': current,
'data-theme': 'd'
})
.append(
$('<label/>', {
'for': 'choice' + current
})
.text('Choice ' + current)
)
);
$("#home").trigger('create')
});
});
