2 回答

TA貢獻(xiàn)1921條經(jīng)驗(yàn) 獲得超9個(gè)贊
display: none在布局文件中使用 div并display:block在需要時(shí)制作
<div style="z-index: 5000; display:none;" id="loadingDiv">
<table style="margin: 0px auto;">
<tr>
<td style="padding-top:200px;" align="center"><img src="https://www.punjabidharti.com/wp-content/plugins/wp-email/images/loading.gif" alt="loading image"/></td>
</tr>
</table>
</div>
$('#usp_form').submit(function() {
// javascript way
document.getElementById("loadingDiv").style.display = 'block';
// jquery way
$('#loadingDiv').show();
});
更新
layout level files can be any of following:
layout.html
index.html
header.html
footer.html
您可以嘗試另一個(gè) gif 圖像,例如https://i.stack.imgur.com/rBLb3.gif

TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超5個(gè)贊
你已經(jīng)在你的 img 中添加了 'style="display:none"' 但在你正在做的代碼中:
$('#img').css('visibility', 'visible');
你應(yīng)該做:
$('#img').css('display', 'inline-block');
添加回答
舉報(bào)