我正在通过 jquery load 加载 html 内容。是否有类似于 jquery $.ajax beforesend 的方法用于 jQuery 加载。在加载内容时显示 gif 微调器
jQuery('.content').load(this.toString());
最佳答案
不是很复杂,加载前显示spinner,加载完成后隐藏在回调中
$('#gifSpinner').show();
$('.content').load(this.toString(), function() {
$('#gifSpinner').hide();
});
关于jQuery 在发送前加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20618146/