1
我試圖動態添加和刪除複選框組的輸入。下面的例子可以工作,但是當輸入被移除時,我不會在最後一個輸入項目上得到圓角邊緣。它只是切斷。我認爲運行checkboxradio('刷新')會糾正這些問題,但事實並非如此。有任何想法嗎?jQuery Mobile,顯示/隱藏複選框/收音機和更新顯示的輸入
if(some condition) {
$('.hideThis').hide();
$('[name=values]').checkboxradio('refresh');
} else {
$('.hideThis').show();
$('[name=values]').checkboxradio('refresh');
}
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<input type="checkbox" name="values" id="val1" value="val1">
<label for="val1">Value 1</label>
<input type="checkbox" name="values" id="val2" value="val2">
<label for="val2">Value 2</label>
<div class="hideThis">
<input type="checkbox" name="values" id="val3" value="val3">
<label for="val3">Value 3</label>
</div>
</fieldset>
</div>
這個工作,但JQM 1.2,我不得不使用addClass(「UI角底UI -controlgroup-last') – 2013-03-18 04:04:50
太棒了:)生病了在我的回答中。 – Omar 2013-03-18 06:35:11