我正在使用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