js如何交替执行两个函数
functionto_hide(obj){obj.animate({left:'250px',opacity:'0.5'},3000);}functionto_show(...
function to_hide(obj){
obj.animate({left:'250px',opacity:'0.5'},3000);
}
function to_show(obj){
obj.animate({left:'0px',opacity:'1'},3000);
}
这两个函数,我想在页面加载后,先隐藏obj,隐藏掉之后,再慢慢显示这个元素,然后再隐藏,反复执行这两个函数,请问下要怎么写?? 展开
obj.animate({left:'250px',opacity:'0.5'},3000);
}
function to_show(obj){
obj.animate({left:'0px',opacity:'1'},3000);
}
这两个函数,我想在页面加载后,先隐藏obj,隐藏掉之后,再慢慢显示这个元素,然后再隐藏,反复执行这两个函数,请问下要怎么写?? 展开
3个回答
展开全部
function to_hide(obj){
obj.animate({left:'250px',opacity:'0.5'},3000,function(){
obj.animate({left:'0px',opacity:'1'},3000,function(){
to_hide(obj);
});
});
}
obj.animate({left:'250px',opacity:'0.5'},3000,function(){
obj.animate({left:'0px',opacity:'1'},3000,function(){
to_hide(obj);
});
});
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
function to_hide(obj){
obj.animate({left:'250px',opacity:'0.5'},3000,function(){
to_show(obj)
});
}
function to_show(obj){
obj.animate({left:'0px',opacity:'1'},3000,function(){
to_hide(obj)
});
}
window.onload=function(){
to_hide(obj)
}
obj.animate({left:'250px',opacity:'0.5'},3000,function(){
to_show(obj)
});
}
function to_show(obj){
obj.animate({left:'0px',opacity:'1'},3000,function(){
to_hide(obj)
});
}
window.onload=function(){
to_hide(obj)
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询