0
我使用JQuery mobile 1.0.1。jQuery Mobile Pagebeforeshow和longlist selectmenu
我創建了一個頁面,下面的代碼
<div data-role="page" id="homecomments">
<div data-role="header">
<h1>Comments</h1>
<a href='#home' class='ui-btn-left' data-icon='home' data-theme="a" data-iconpos="notext">Home</a>
</div>
<div data-role="content">
<select name="building" id="opt1" data-native-menu="false">
<option>building</option>
</select>
</div>
</div>
我呼籲與
$('#homecomments').live('pagebeforeshow', function() {
getTitlesComments()
});
和
$(document).delegate("#homecomments", "pagecreate", function() {
$("#opt1").change(function() {
if ($("#opt1 option:selected").val() != 0) {
====================DO SOMETHING=======================
}
});
和
function getTitlesComments() {
$('#opt1').val('');
$("#opt1").selectmenu('refresh');
==========dynimicaly create longlist selectmenu opt1========
}
012頁
我必須在選擇菜單中使用長列表。每當我從長列表中選擇選擇菜單。
我該如何解決這個問題?