我们获取本地SqLiteDB
的数据。然后我们将数据显示到ListView
中。但这需要一些时间。所以我们需要loadingMessage
像这
我们尝试过这样
$('#content').append('<img src="../images/Loading_Animation.gif" alt="US Flag" "/>');
但运气不佳。请任何人指导我。请任何人告诉我是否还有其他最佳方法
最佳答案
试试这个我希望它会起作用
**HTML**
//hide image where do you want to show
<img src="filename.gif" id="loadinggif" style="display:none">
**JQuery**
//before ajax call show gif image
$("#loadinggif").show();
$.ajax({
url: 'filename.php',
type: 'POST',
success: function(data) {
//after ajax success hide gif
$("#loadinggif").hide();
console.log(data);
}
});
关于jquery - gif 加载图像在 jquerymoblie 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27525052/