我有一个问题..我有一页是这样的:
<div data-role="content">
<div id="loadingSchedaAuto" ></div>
<div id="datiAuto" style="display:none">
<img src="" class="imgPrincipale" alt="" width="100%" height="auto" style="padding:2px; border:1px solid #000;" />
<p class="nome" align="center"></p>
<ul style="padding: 5px; " data-role="listview" data-inset="true" data-theme="a" >
<li data-role="list-divider">Dati generali</li>
<li>
<strong>Prezzo</strong>: <span class="prezzo" style="color:#E30025; font-weight: bold;"></span>
</li>
<li>
<strong>Alimentazione</strong>: <span class="alimentazione"></span>
</li>
<li>
<strong>Cilindrata</strong>: <span class="cilindrata"></span>
</li>
<li>
<strong>Potenza</strong>: <span class="potenza"></span>
</li>
<li>
<strong>Colore</strong>: <span class="colore"></span>
</li>
<li id="immatricolazione" > <!-- id aggiunto per poter inserire una li degli interni dopo immatricolazione -->
<strong>Immatricolazione</strong>: <span class="immatricolazione"></span>
</li>
<div data-role="collapsible" data-collapsed="true" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d">
<h3>Cambio</h3>
<ul data-role="listview">
<li>
<span class="cambio"></span>
</li>
</ul>
</div>
<div data-role="collapsible" data-collapsed="true" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" id="equipaggiamento">
<h3>Equipaggiamento</h3>
<ul class="equip" data-role="listview" data-mini="true"></ul>
</div>
</ul>
</div>
</div>
id=datiAuto 的 div 是动态的,我需要在每次加载之前显示加载消息。
我做了这个功能:
function showLoading(loading, scheda) {
alert("load pagina");
$(loading).show();
$(scheda).hide();
};
function showSchedaAuto(loading, scheda) {
$(loading).remove();
alert("pagina caricata");
$(scheda).show();
};
我在这里调用这个函数:
$(document).delegate("#scheda-auto", "pageshow", function() {
showLoading("#loadingSchedaAuto", "#datiAuto");
$("#scheda-auto").load("scheda.html #datiAuto", function() {
showSchedaAuto("#loadingSchedaAuto", "#datiAuto");
});..................
这工作一次,但我第二次尝试显示 Div,页面是空白的!
任何人都可以帮助我吗?
谢谢!大卫