我失败了,但我无法解决这个问题。我有这个代码:
<script>
//Init Historyview
$('#history').live('pageinit', function () {
$.getJSON('../BackEnd/GetHistory.aspx', function (json) {
$.each(json, function (titel, date) {
if (date.status == "2") {
$('#historylist').find('ul.dynlist').append('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + date.titel + '" data-rel="popup" data-icon="alert" data-transition="slide">Details</a></li>');
}
else {
if (date.status == "3")
$('#historylist').find('ul.dynlist').append('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + date.titel + '" data-rel="popup" data-icon="delete" data-transition="slide">Details</a></li>');
else
$('#historylist').find('ul.dynlist').append('<li><a><img class="rotate" src="' + date.beleg + '"><h1>' + date.titel + '</h1><p>' + date.date + '</p></a><a href="#' + date.titel + '" data-rel="popup" data-icon="check" data-transition="slide">Details</a></li>');
}
$('#uList').listview("refresh");
$(document).html('<div data-role="popup" id="" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">Hallo</div>');
$.mobile.page();
});
});
});
</script>
该列表效果很好,但我想div
通过选择li
元素来打开弹出窗口。如果我点击什么都不会发生。
它应该看起来像这个正在工作的示例:
<ul data-role="listview" data-split-icon="plus" data-split-theme="b">
<li><a><img class="rotate" src="bilder/Rechnung.jpg"><h1>Krankenhaus Basel</h1><p>24.11.2008</p></a><a href="#rechnung" data-rel="popup" data-icon="check" data-transition="slide">Details</a></li>
<li><a><img class="rotate" src="bilder/rechnung-ausdruck.jpg"><h1>Praxis Fuchs</h1><p>11.04.2012</p></a><a href="#rechnung2" data-rel="popup" data-icon="alert" data-transition="slide">Details</a></li>
<li><a><img class="rotate" src="bilder/RechnungBericht.jpg"><h1>Praxis Steinig</h1><p>12.11.2012</p></a><a href="#rechnung3" data-rel="popup" data-icon="delete" data-transition="slide">Details</a></li>
</ul>
<div data-role="popup" id="rechnung" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">
<img src="bilder/Rechnung.jpg"><p>Rechnung wurde akzeptiert</p>
</div>
<div data-role="popup" id="rechnung2" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">
<img src="bilder/rechnung-ausdruck.jpg"><p>Rechnung in der Verarbeitung</p>
</div>
<div data-role="popup" id="rechnung3" data-theme="d" data-overlay-theme="b" class="ui-content" style="max-width:340px;">
<img src="bilder/RechnungBericht.jpg"><p>Rechnung wurde noch nicht bearbeitet</p>
</div>