我正在使用jquery ajax更改網頁中的頁面。我的代碼是這樣的:使用jQuery Ajax進行平滑淡入淡出
$('#'+target).fadeOut('slow', function(){
$('#' + target).children().remove().end().append('<div style="width:' + loadingImageWidth + 'px;height:' + loadingImageHeight + 'px;background-color:black;-moz-border-radius:15px;"></div>');
$('#'+target).fadeIn('slow', function(){
$.ajax({
type: type,
url: url,
success: function(msg){
$('#'+target).fadeOut('slow', function(){
$('#'+target).html(msg);
$('#'+target).fadeIn('slow', function(){});
});
}
});
});
});
我的問題是,當我使用褪色,「#target」 div的寬度和高度的變化,因此,我的網頁的滾動變化,這實在是煩人,因爲它似乎在頁面跳躍起來下來!我想知道如何以平滑的效果使用JQuery漸變。 thanx傢伙。
Thanx男人,我沒有使用你的代碼,但我寫了一個關於設置父母的寬度和高度的想法的代碼。我在目標周圍創建了一個新的div,並使用Ajax更改了它的寬度和高度。 Thanx;) – AliBZ 2010-12-05 20:08:11