我試過the solutions to this question無濟於事。如果沒有結果,顯示一條消息jQuery Mobile 1.4.3
通過試驗和錯誤我發現這個解決方案不適用於jQuery Mobile 1.4.3(JSFiddle to prove it)。
$(document).delegate('[data-role="page"]', 'pageinit', function() {
var $listview = $(this).find('[data-role="listview"]');
$(this).delegate('input[data-type="search"]', 'keyup', function() {
if ($listview.children(':visible').not('#no-results').length === 0) {
$('#no-results').fadeIn(500);
} else {
$('#no-results').fadeOut(250);
}
});
});
有沒有人知道另一個解決方案呢?