問題
JQuery Mobileサイトがあり、フィールドセットの属性をからに動的に変更しようとしていdata-type='horizontal'
ますdata-type='vertical'
。DOMを変更することはできますが、変更が行われた後、JQMにブラウザーでのDOMの表示を更新させることはできません。
リストとラジオボタンの属性を更新する例はたくさんありますが、フィールドセットの属性は見ていません。
コード
if(e.orientation == "portrait"){
//In portrait mode, all radio buttons should be vertical.
$('fieldset').attr('data-type', 'vertical').controlgroup('refresh');
}
else{
//In landscape mode, all radio buttons should be horizontal.
$('fieldset').attr('data-type', 'horizontal').controlgroup('refresh');
}
//trigger the page to recreate itself.
$('#newentry').trigger('create');
結論
私はもう試した:
checkboxradio('refresh')
そしてこれは私に与えます:
cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'.
これに関する助けをいただければ幸いです。
ありがとう。