我有一个登录页面,其中包含一个由按钮单击触发的简短 jQuery 动画,动画结束后,我希望它重定向到服务器上的另一个页面,但我希望它从登录页面淡入到另一个页面。
目前我已经设置好了,所以它会在重定向到另一个页面之前淡化文档正文,但它会淡化为白色,所以当淡化开始时你可以看到白色背景而不是我的彩色背景。我猜有更好的方法来实现这种效果。
这是我当前的代码:
$(document).ready(function(){
$("#button").click(function(){
$(".left").animate(
{left:'50%'}, 800, 'linear'
);
$(".right").animate(
{right:'50%'}, 800, 'linear'
);
$(".top").stop(true, true).delay(800).animate(
{top:'36px'}, 800, 'easeOutBounce'
);
$(".bot").stop(true, true).delay(800).animate(
{top:'492px'}, 800, 'easeOutBounce'
);
$(document.body).delay(1900).fadeTo("slow", 0);
setTimeout(function ()
{ window.location.href = "start.php"; }, 2000);
});
});