我一直在玩菜单上的缓动,这让我头晕目眩。我有一个菜单,当您单击它时,它会将相关内容简化为视图。我不确定使用什么搜索词来让元素出现而不是轻松。而不是从 -1000px 到 0px 的动画,直接从一个到另一个。
这是我从 CODROPS 中使用的代码,
我正在尝试修改或替换它,因此页面不会轻松查看,它只是闪烁出现。
if(idx > current){
$current.stop().animate({'top':'-1000px'},600,'linear',function(){
$(this).css({'top':'310px'});
});
$next.css({'top':'1000px'}).stop().animate({'top':'5px'},600,'linear');
}
/* UP THE LIST */ else if(idx < current){
$current.stop().animate({'top':'1000px'},600,'linear',function(){
$(this).css({'top':'1000px'});
});
$next.css({'top':'-1000px'}).stop().animate({'top':'5px'},600,'linear');
}