There are many approaches to do this.
A simple way to do:
<div style="display:none" id="dvloader"><img src="loading.gif" /></div>
JS:
$(function() {
$(".changepass").click(function() {
$("#dvloader").show();
$(".block1").load("views/changepass.template.php", function(){ $("#dvloader").hide(); });
return false;
});
});
Edited display:block to show() after suggestion from James Wiseman :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…