次のようにコードコードをコピーします。
/*ajax送信遅延待機効果*/
var ajaxloding = new object();
// wraperid:積み込み画像を表示するコンテナ要素
// MS:積み込みアイコンの長さが表示されます、ミリ秒
// envent:イベントのイベントイベントのソースは、出発イベントのオブジェクトを取得するために使用されます
//コールバック:アニメーションが終了した後に実行された回復方法を表します
// stop()メソッド回復方法が正常に実行された後に動作する隠されたアニメーションの操作を示します
ajaxloding.load = function(lodingid、ms、event、left、top、callback){
if(!left || typeof left == undefined)
左= 0;
if(!top || typeof top == undefined)
TOP = 0;
this.lodingid = lodingid;
this.obj = $( "#" + this.lodingid);
this.sourceevengenelement = $(event.currentTarget);
this.start = function(){
this.obj.css({positin: "相対"});
this.sourceeveentelement.attr( "disabled"、true);
//デフォルトでアイコンアイコンとLodingIDを表示し、次のスタイルを設定します
var imgobj = $( "<img src = '/images/loaderc.gif' style = 'position:absolute; width:32px; height:32px;' id = 'img_loding'" ");
imgobj.css({左:this.obj.width() / 2- imgobj.width() / 3-heft、top:this.obj.height() / 2-imgobj.heigh() / 2-top})) ;;
imgobj.appendto(this.obj);
this.obj.animate({height:this.obj.height()}、ms、function(){
折り返し電話 ();
});
};
this.stop = function(){
$( "#img_loding")。
this.sourceeveentelement.attr( "disabled"、false);
}
};
呼び出し方法:
次のようにコードコードをコピーします。
$( "#elementId")。
var obj = new ajaxloding.load( "div_test"、2000、e、0,0、function(){
// alert( "提出の成功!");
obj.stop();
});
obj.start();
});
これは私が使用する積み込みアイコンです。自分で交換できます。