我想加載一個div內的頁面與fadeTo效果。 我創造了這個功能對於不錯的jquery加載效果
function show(div) {
$("#showdata").fadeTo(300,0.0,function() {
$("#showdata")
.html('<img src="images/loading.gif" />')
.load('includes/show/'+div+'.inc.php')
.fadeTo(300,1.0);;
});
}
從當前內容褪色的圖像是好的,但在此之後,新內容彈出突然。
我也嘗試過這一點,但同樣的結果:
function show(div) {
$("#showdata").fadeTo(300,0.0,function() {
$("#showdata")
.html('<img src="images/loading.gif" />')
.load('includes/show/'+div+'.inc.php',$("#showdata").fadeTo(300,1.0));
});
}