我想添加一個進度動畫到一個函數,以便它顯示在函數的開頭,然後消失在它的結尾。JQuery函數添加進度動畫
喜歡的東西:
<script type="text/javascript">
function myfunction() {
//Display progress animation here
$('input[type=submit]#submit').click();
etc...
//Hide the progress animation here
}
?>
UPDATE:
這是我目前的Ajax代碼:
<script type="text/javascript">
function myfunction() {
$("#ajax-form").submit(function(){
$.post("submit.php",
$("#ajax-form").serialize(),
function(data){
mysubmitForm();
}
);
return false;
});
}
</script>
[.show()](http://docs.jquery.com/Show)和[ .hide()](http://docs.jquery.com/Hide)。 – JJJ 2012-02-16 14:54:26
即將發生的事情 - 你打算去檢索一些數據嗎?我們需要更多的信息 – MMM 2012-02-16 14:55:09
上面添加的代碼 – Satch3000 2012-02-16 15:28:08